Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert and simplify msg/process-lifetime
[simgrid.git] / examples / c / CMakeLists.txt
1 # Regular examples: with only one source and tested with all factories
2 ######################################################################
3
4 foreach(x
5         actor-create actor-daemon actor-exiting actor-join actor-kill actor-lifetime actor-migrate actor-suspend 
6         actor-yield
7         app-pingpong app-token-ring 
8         async-wait async-waitall async-waitany
9         cloud-capping cloud-migration cloud-simple
10         exec-dvfs
11         energy-exec energy-exec-ptask energy-vm
12         io-disk-raw io-file-remote
13         plugin-hostload)
14   add_executable       (${x}-c EXCLUDE_FROM_ALL ${x}/${x}.c)
15   target_link_libraries(${x}-c simgrid)
16   set_target_properties(${x}-c PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
17   add_dependencies(tests ${x}-c)
18
19   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
20   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
21 endforeach()
22
23 # Multi-files examples
24 ######################
25 # Chainsend example
26
27 add_executable       (app-chainsend-c EXCLUDE_FROM_ALL app-chainsend/chainsend.c app-chainsend/broadcaster.c 
28                       app-chainsend/peer.c)
29 target_link_libraries(app-chainsend-c simgrid)
30 set_target_properties(app-chainsend-c PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-chainsend)
31 add_dependencies(tests app-chainsend-c)
32
33 foreach (file chainsend broadcaster peer)
34   set(teshsuite_src  ${teshsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/${file}.c)
35 endforeach()
36 set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/chainsend.h)
37
38 # Add all extra files to the archive
39 ####################################
40
41 set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
42 set(tesh_files    ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/app-chainsend.tesh
43                                 PARENT_SCOPE)
44
45 set(xml_files     ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/actor-create_d.xml
46                                ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/actor-lifetime_d.xml
47                                ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/actor-yield_d.xml
48                                ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/app-chainsend_d.xml
49                                ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/app-pingpong_d.xml
50                                ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait_d.xml
51                                ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait2_d.xml
52                                ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait3_d.xml
53                                ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait4_d.xml
54                                ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/async-waitall_d.xml
55                                ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/async-waitany_d.xml
56                                ${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/io-file-remote_d.xml
57                                PARENT_SCOPE)
58
59 foreach(x
60         actor-create actor-daemon actor-exiting actor-join actor-kill actor-lifetime actor-migrate actor-suspend 
61         actor-yield
62         app-chainsend app-pingpong app-token-ring
63         async-wait async-waitall async-waitany
64         cloud-capping cloud-migration cloud-simple
65         exec-dvfs
66         energy-exec energy-exec-ptask energy-vm
67         io-disk-raw io-file-remote
68         plugin-hostload)
69   ADD_TESH(c-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
70                   --setenv bindir=${CMAKE_BINARY_DIR}/examples/c/${x}
71                   --cd ${CMAKE_HOME_DIRECTORY}/examples/c/${x}
72                   ${CMAKE_HOME_DIRECTORY}/examples/c/${x}/${x}.tesh)
73 endforeach()