Logo AND Algorithmique Numérique Distribuée

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