annotate src/parallel_execution/CMakeLists.txt @ 278:23767f714f4a

fix generate_stub
author mir3636
date Thu, 02 Feb 2017 20:27:56 +0900
parents b6ed4b2a5d9d
children 2c2e4e597eb0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 98
diff changeset
3 # -DUSE_CUDA
138
04a2f486a30d insert works but is not balanced
kono
parents: 137
diff changeset
4 # add_definitions("-Wall -g -O")
137
909d0548284f fix stackClear
mir3636
parents: 131
diff changeset
5 add_definitions("-Wall -g")
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
131
a4507906938c Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 117
diff changeset
7 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
188
6ab77dec8b6a add command execution in CMakeList.txt
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 138
diff changeset
8
198
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
9 macro( GearsCommand )
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
10 set( _OPTIONS_ARGS )
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
11 set( _ONE_VALUE_ARGS TARGET )
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
12 set( _MULTI_VALUE_ARGS SOURCES )
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
13 cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
255
79bbe2c63fb0 cmake generate c from cbc
mir3636
parents: 218
diff changeset
14
256
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
15 set (_Gears_CSOURCES)
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
16 foreach(i ${_Gears_SOURCES})
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
17 if (${i} MATCHES "\\.cbc")
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
18 string(REGEX REPLACE "(.*).cbc" "c/\\1.c" j ${i})
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
19 add_custom_command (
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
20 OUTPUT ${j}
259
195518ab62fc fix type gathering pattern match in generate_stub.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 257
diff changeset
21 DEPENDS ${i}
256
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
22 COMMAND "perl" "generate_stub.pl" "-o" ${j} ${i}
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
23 )
270
b6ed4b2a5d9d fix CMakeList
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
24 else()
256
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
25 set(j ${i})
270
b6ed4b2a5d9d fix CMakeList
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
26 endif()
256
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
27 list(APPEND _Gears_CSOURCES ${j})
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
28 endforeach(i)
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
29
210
ba56dab79dc4 separate code init for each executable
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 208
diff changeset
30 add_custom_command (
ba56dab79dc4 separate code init for each executable
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 208
diff changeset
31 OUTPUT c/${_Gears_TARGET}-context.c
256
d2f5d6fc56fa fix cmake file
mir3636
parents: 255
diff changeset
32 DEPENDS ${_Gears_CSOURCES}
255
79bbe2c63fb0 cmake generate c from cbc
mir3636
parents: 218
diff changeset
33 COMMAND "perl" "generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CSOURCES}
210
ba56dab79dc4 separate code init for each executable
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 208
diff changeset
34 )
255
79bbe2c63fb0 cmake generate c from cbc
mir3636
parents: 218
diff changeset
35 add_executable(${_Gears_TARGET} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c)
198
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
36 endmacro()
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
37
210
ba56dab79dc4 separate code init for each executable
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 208
diff changeset
38
198
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
39 GearsCommand(
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
40 TARGET
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
41 twice
4051c012dec3 cmake macro
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 188
diff changeset
42 SOURCES
278
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
43 main.cbc RedBlackTree.cbc SingleLinkedStack.cbc CPUWorker.cbc time.cbc twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
44 )
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
45
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
46 GearsCommand(
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
47 TARGET
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
48 queue_test
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
49 SOURCES
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
50 test/queue_test.c SingleLinkedQueue.cbc
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 )
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
202
42dbe54332a0 add test
mir3636
parents: 199
diff changeset
53 GearsCommand(
42dbe54332a0 add test
mir3636
parents: 199
diff changeset
54 TARGET
210
ba56dab79dc4 separate code init for each executable
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 208
diff changeset
55 stack_test
202
42dbe54332a0 add test
mir3636
parents: 199
diff changeset
56 SOURCES
278
23767f714f4a fix generate_stub
mir3636
parents: 270
diff changeset
57 test/stack_test.c SingleLinkedStack.cbc
202
42dbe54332a0 add test
mir3636
parents: 199
diff changeset
58 )
42dbe54332a0 add test
mir3636
parents: 199
diff changeset
59