Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
yet another msg examples thrown away
[simgrid.git] / examples / msg / CMakeLists.txt
1 # C examples
2 foreach(x app-masterworker app-token-ring 
3           cloud-capping cloud-masterworker cloud-migration cloud-simple
4           dht-pastry energy-consumption energy-onoff energy-vm platform-failures 
5           plugin-hostload
6           process-create 
7           synchro-semaphore trace-categories 
8           trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform 
9           trace-process-migration trace-host-user-variables)
10   add_executable       (${x}     ${x}/${x}.c)
11   target_link_libraries(${x}     simgrid)
12   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
13   set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
14   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
15 endforeach()
16
17 # CPP examples
18 foreach(x maestro-set)
19   add_executable       (${x}     ${x}/${x}.cpp)
20   target_link_libraries(${x}     simgrid)
21   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
22   set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
23   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
24 endforeach()
25
26 if(SIMGRID_HAVE_NS3)
27   add_executable       (network-ns3 network-ns3/network-ns3.c)
28   target_link_libraries(network-ns3 simgrid)
29   set_target_properties(network-ns3  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
30 endif()
31
32 add_executable       (chainsend app-chainsend/chainsend.c app-chainsend/iterator.c app-chainsend/common.c app-chainsend/messages.c app-chainsend/broadcaster.c app-chainsend/peer.c)
33 target_link_libraries(chainsend simgrid)
34 set_target_properties(chainsend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-chainsend)
35 foreach (file common iterator messages broadcaster peer)
36   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/${file}.h)
37 endforeach()
38
39 add_executable       (dht-kademlia dht-kademlia/dht-kademlia.c dht-kademlia/node.c dht-kademlia/routing_table.c dht-kademlia/task.c dht-kademlia/answer.c)
40 target_link_libraries(dht-kademlia simgrid)
41 set_target_properties(dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
42 foreach (file answer dht-kademlia node routing_table task)
43   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c  ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h)
44 endforeach()
45
46 foreach (file app-chainsend app-masterworker dht-kademlia dht-pastry)
47   set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
48 endforeach()
49
50 set(txt_files    ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/README.doc          PARENT_SCOPE)
51 set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py
52                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/generate.py                       PARENT_SCOPE)
53 set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/chainsend.c
54                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/common.h
55                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.c                    PARENT_SCOPE)
56 set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/app-chainsend.tesh
57                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/dht-kademlia.tesh
58                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore.tesh
59                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi.tesh
60                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/network-ns3.tesh                 PARENT_SCOPE)
61 set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore_d.xml
62                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi_d.xml
63                                   ${CMAKE_CURRENT_SOURCE_DIR}/energy-onoff/platform_onoff.xml
64                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3hosts_2links_d.xml
65                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links-timer_d.xml
66                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/3links_d.xml
67                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/crosstraffic_d.xml
68                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/dogbone_d.xml
69                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/onelink_d.xml
70                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml
71                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/two_clusters_d.xml       PARENT_SCOPE)
72
73 foreach(x app-chainsend app-masterworker app-token-ring
74           cloud-capping cloud-masterworker cloud-migration cloud-simple 
75           dht-pastry dht-kademlia platform-failures
76           energy-consumption energy-onoff energy-vm
77           plugin-hostload
78           process-create 
79           synchro-semaphore)
80   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" 
81                               --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x}
82                               --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/${x} 
83                               --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
84                               ${CMAKE_HOME_DIRECTORY}/examples/msg/${x}/${x}.tesh)
85 endforeach()
86
87 foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform trace-process-migration trace-host-user-variables)
88   ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x}
89                     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/${x} 
90                     --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
91                     ${CMAKE_HOME_DIRECTORY}/examples/msg/${x}/${x}.tesh)
92 endforeach()
93
94 ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "thread;ucontext;raw;boost" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} 
95                                              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/dht-kademlia 
96                                              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia
97                                              --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
98                                              ${CMAKE_HOME_DIRECTORY}/examples/msg/dht-kademlia/dht-kademlia.tesh)
99
100 if(NOT WIN32)
101   ADD_TESH_FACTORIES(msg-maestro-set   "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/maestro-set/maestro-set.tesh)
102 else()
103   message("Test maestro-set disabled on windows: this feature is not working")
104 endif()
105
106 ADD_TESH_FACTORIES(app-masterworker-multicore   "thread;ucontext;raw;boost" 
107                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker 
108                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/app-masterworker
109                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
110                                                 ${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker/app-masterworker-multicore.tesh)
111 ADD_TESH_FACTORIES(app-masterworker-vivaldi     "thread;ucontext;raw;boost" 
112                                                 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker 
113                                                 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/app-masterworker
114                                                 --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
115                                                 ${CMAKE_HOME_DIRECTORY}/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh)
116
117 if(SIMGRID_HAVE_NS3)
118   ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost"
119                                       --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg
120                                       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg
121                                       --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
122                                       ${CMAKE_HOME_DIRECTORY}/examples/msg/network-ns3/network-ns3.tesh)
123 endif()