# HG changeset patch # User mir3636 # Date 1485517228 -32400 # Node ID d2f5d6fc56fadf1bf27bcbc6dfec1eb4bc2a8c13 # Parent 79bbe2c63fb0217c9c6441ea291b8b15e009ddf3 fix cmake file diff -r 79bbe2c63fb0 -r d2f5d6fc56fa src/parallel_execution/CMakeLists.txt --- a/src/parallel_execution/CMakeLists.txt Fri Jan 27 18:24:15 2017 +0900 +++ b/src/parallel_execution/CMakeLists.txt Fri Jan 27 20:40:28 2017 +0900 @@ -12,17 +12,29 @@ set( _MULTI_VALUE_ARGS SOURCES ) cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} ) - set(_Gear_CSOURCES string(REGEX REPLACE "([^ ]*)\\.cbc" "c/\\1.c" ${_Gears_SOURCES})) - + 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_custom_command ( - DEPENDS ${_Gears_SOURCES} - OUTPUT ${_Gears_CSOURCES} - COMMAND "perl" "generate_stub.pl" "-d" "-c" ${_Gears_SOURCES} - ) add_executable(${_Gears_TARGET} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c) endmacro()