comparison src/parallel_execution/CMakeLists.txt @ 199:9c85c3a34726

Cmake macro
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 19 Dec 2016 11:36:18 +0900
parents 4051c012dec3
children 42dbe54332a0
comparison
equal deleted inserted replaced
198:4051c012dec3 199:9c85c3a34726
4 # add_definitions("-Wall -g -O") 4 # add_definitions("-Wall -g -O")
5 add_definitions("-Wall -g") 5 add_definitions("-Wall -g")
6 6
7 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) 7 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
8 8
9 add_custom_command (
10 OUTPUT c/enumCode.h
11 COMMAND "perl" "generate_context.pl"
12 )
13
14 macro( GearsCommand ) 9 macro( GearsCommand )
15
16 set( _OPTIONS_ARGS ) 10 set( _OPTIONS_ARGS )
17 set( _ONE_VALUE_ARGS TARGET ) 11 set( _ONE_VALUE_ARGS TARGET )
18 set( _MULTI_VALUE_ARGS SOURCES ) 12 set( _MULTI_VALUE_ARGS SOURCES )
19
20 cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} ) 13 cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
21 14 add_custom_command (
22 # message("target = ${_Gears_TARGET}") 15 OUTPUT c/enumCode.h
23 # message("sources = ${_Gears_SOURCES}") 16 COMMAND "perl" "generate_context.pl" ${_Gears_SOURCES}
24 17 )
25 add_executable(${_Gears_TARGET} ${_Gears_SOURCES}) 18 add_executable(${_Gears_TARGET} ${_Gears_SOURCES} context.c c/enumCode.h )
26 endmacro() 19 endmacro()
27 20
28 GearsCommand( 21 GearsCommand(
29 TARGET 22 TARGET
30 twice 23 twice
31 SOURCES 24 SOURCES
32 main.c 25 main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c
33 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
34 ) 26 )
35 27