# HG changeset patch # User Shinji KONO # Date 1482065320 -32400 # Node ID 4051c012dec3ee1d800844439537700ead85fbba # Parent de7c0bbfc91fc7ddb12128d42418a24aa8544dec cmake macro diff -r de7c0bbfc91f -r 4051c012dec3 src/parallel_execution/CMakeLists.txt --- a/src/parallel_execution/CMakeLists.txt Fri Dec 16 23:41:27 2016 +0900 +++ b/src/parallel_execution/CMakeLists.txt Sun Dec 18 21:48:40 2016 +0900 @@ -5,26 +5,31 @@ add_definitions("-Wall -g") set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) - add_custom_command ( OUTPUT c/enumCode.h COMMAND "perl" "generate_context.pl" ) +macro( GearsCommand ) -add_executable(twice - main.c - context.c - rb_tree.c - stack.c - origin_cs.c - allocate.c - compare.c - worker.c - dependency.c - time.c - twice.c - c/enumCode.h + 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} ) + + # message("target = ${_Gears_TARGET}") + # message("sources = ${_Gears_SOURCES}") + + add_executable(${_Gears_TARGET} ${_Gears_SOURCES}) +endmacro() + +GearsCommand( + TARGET + twice + SOURCES + main.c + context.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c c/enumCode.h )