Mercurial > hg > GearsTemplate
view src/parallel_execution/CMakeLists.txt @ 256:d2f5d6fc56fa
fix cmake file
author | mir3636 |
---|---|
date | Fri, 27 Jan 2017 20:40:28 +0900 |
parents | 79bbe2c63fb0 |
children | cd3486e4ba70 |
line wrap: on
line source
cmake_minimum_required(VERSION 2.8) # -DUSE_CUDA # add_definitions("-Wall -g -O") add_definitions("-Wall -g") set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) macro( GearsCommand ) set( _OPTIONS_ARGS ) set( _ONE_VALUE_ARGS TARGET ) set( _MULTI_VALUE_ARGS SOURCES ) cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} ) set (_Gears_CSOURCES) foreach(i ${_Gears_SOURCES}) if (${i} MATCHES "\\.cbc") string(REGEX REPLACE "(.*).cbc" "c/\\1.c" j ${i}) add_custom_command ( OUTPUT ${j} DEPENDS ${i} COMMAND "perl" "generate_stub.pl" "-o" ${j} ${i} ) else(${i} MATCHES "\\.cbc") set(j ${i}) endif(${i} MATCHES "\\.cbc") list(APPEND _Gears_CSOURCES ${j}) endforeach(i) #message(${_Gears_SOURCES}) #message(${_Gears_CSOURCES}) add_custom_command ( OUTPUT c/${_Gears_TARGET}-context.c DEPENDS ${_Gears_CSOURCES} COMMAND "perl" "generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CSOURCES} ) add_executable(${_Gears_TARGET} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c) endmacro() GearsCommand( TARGET twice SOURCES main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c taskManager.c queue.c ) GearsCommand( TARGET stack_test SOURCES origin_cs.c test/stack_test.c stack.c ) GearsCommand( TARGET queue_test SOURCES origin_cs.c test/queue_test.c queue.c ) GearsCommand( TARGET cbc_stack_test SOURCES origin_cs.c test/stack_test.c SingleLinkedStack.cbc )