Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
3d0652da636ecf40286c9c1ec0e4b9b58ee5c5ab
[simgrid.git] / examples / s4u / CMakeLists.txt
1
2 # Regular examples: with only one source and tested with all factories
3 ######################################################################
4
5 foreach (example actor-create actor-daemon actor-join actor-kill
6                  actor-lifetime actor-migrate actor-suspend actor-yield
7                  app-chainsend app-pingpong app-token-ring
8                  async-ready async-wait async-waitany async-waitall async-waituntil
9                  cloud-capping cloud-migration cloud-simple
10                  energy-exec energy-boot energy-link energy-vm
11                  engine-filtering
12                  exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
13                  io-async io-file-system io-file-remote io-storage-raw
14                  platform-failures platform-properties plugin-hostload 
15                  replay-comm replay-storage
16                  routing-get-clusters
17                  synchro-barrier synchro-mutex synchro-semaphore)
18   add_executable       (s4u-${example} ${example}/s4u-${example}.cpp)
19   target_link_libraries(s4u-${example} simgrid)
20   set_target_properties(s4u-${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
21
22   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.tesh)
23   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.cpp)
24   
25   ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost"
26                                     --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} 
27                                     --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
28                                     --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} 
29                                     ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
30 endforeach()
31
32 set_tesh_properties(s4u-platform-failures "thread;ucontext;raw;boost" WILL_FAIL TRUE) # FIXME
33
34 # Multi-files examples
35 ######################
36
37 # MASTERWORKERS EXAMPLE
38 foreach(variant fun class) 
39   add_executable       (s4u-app-masterworkers-${variant}  app-masterworkers/s4u-app-masterworkers-${variant}.cpp)
40   target_link_libraries(s4u-app-masterworkers-${variant}  simgrid)
41   set_target_properties(s4u-app-masterworkers-${variant}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-masterworkers)
42
43   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers-${variant}.cpp)
44 endforeach()
45 set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers.tesh)
46
47 # CHORD EXAMPLE
48 add_executable       (s4u-dht-chord dht-chord/s4u-dht-chord.cpp dht-chord/s4u-dht-chord-node.cpp)
49 target_link_libraries(s4u-dht-chord simgrid)
50 set_target_properties(s4u-dht-chord PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-chord)
51 foreach (file s4u-dht-chord s4u-dht-chord-node)
52   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/${file}.cpp)
53 endforeach()
54 set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.hpp)
55
56 # KADEMLIA EXAMPLE
57 add_executable       (s4u-dht-kademlia dht-kademlia/s4u-dht-kademlia.cpp dht-kademlia/node.cpp 
58                       dht-kademlia/routing_table.cpp dht-kademlia/answer.cpp)
59 target_link_libraries(s4u-dht-kademlia simgrid)
60 set_target_properties(s4u-dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
61 foreach (file answer routing_table node s4u-dht-kademlia)
62   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.cpp 
63                                      ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.hpp)
64 endforeach()
65 set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/message.hpp)
66
67 # BITTORRENT EXAMPLE
68 add_executable       (s4u-bittorrent app-bittorrent/s4u-bittorrent.cpp app-bittorrent/s4u-peer.cpp
69                       app-bittorrent/s4u-tracker.cpp)
70 target_link_libraries(s4u-bittorrent simgrid)
71 set_target_properties(s4u-bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
72 foreach (file s4u-bittorrent s4u-peer s4u-tracker)
73   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.cpp
74                                      ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.hpp)
75 endforeach()
76
77 foreach(example app-bittorrent app-masterworkers 
78                 dht-chord dht-kademlia
79                 )
80   ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" 
81                                     --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} 
82                                     --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
83                                     --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} 
84                                     ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
85 endforeach()
86
87 # Examples not accepting factories
88 ##################################
89
90 foreach (example trace-platform)
91   add_executable       (s4u-${example} ${example}/s4u-${example}.cpp)
92   target_link_libraries(s4u-${example} simgrid)
93   set_target_properties(s4u-${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
94
95   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.tesh)
96   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.cpp)
97   
98   ADD_TESH(s4u-${example} --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example}
99                           --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
100                           ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
101 endforeach()
102
103 if (NOT enable_memcheck AND NOT WIN32)
104   ADD_TESH(simix-breakpoint --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/app-pingpong
105                             --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
106                             ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/simix-breakpoint.tesh)
107 endif()
108
109 # Add all extra files to the archive
110 ####################################
111
112 set(examples_src  ${examples_src}                                                                          PARENT_SCOPE)
113 set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent.tesh
114                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/simix-breakpoint.tesh
115                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.tesh
116                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/s4u-dht-kademlia.tesh
117                   PARENT_SCOPE)
118 set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml
119                                   ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml
120                                   ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield_d.xml
121                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent_d.xml
122                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers_d.xml
123                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_d.xml
124                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany_d.xml
125                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall_d.xml
126                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_d.xml
127                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-ready/s4u-async-ready_d.xml
128                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-waituntil/s4u-async-waituntil_d.xml
129                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml
130                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/s4u-dht-kademlia_d.xml
131                                   ${CMAKE_CURRENT_SOURCE_DIR}/energy-boot/platform_boot.xml
132                                   ${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/s4u-io-file-remote_d.xml
133                                   ${CMAKE_CURRENT_SOURCE_DIR}/platform-properties/s4u-platform-properties_d.xml
134                                   ${CMAKE_CURRENT_SOURCE_DIR}/platform-failures/s4u-masterworker-failures_d.xml
135                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split_d.xml
136                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm_d.xml
137                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-storage/s4u-replay-storage_d.xml
138                   PARENT_SCOPE)
139 set(bin_files     ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py                     PARENT_SCOPE)
140 set(txt_files     ${txt_files}    ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p0.txt
141                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p1.txt
142                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm.txt
143                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-storage/s4u-replay-storage.txt
144                                   ${CMAKE_CURRENT_SOURCE_DIR}/README.rst                                   PARENT_SCOPE)
145