Logo AND Algorithmique Numérique Distribuée

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