-In each of these directories, there is a CMakeLists.txt file that has to be edited to include the new examples. For
-instance, examples/msg/CMakeLists.txt starts with a loop over all the (currently) existing tests in which we
- - compile and link the source file (which has to be named as the directory
- - add the source and tesh files to the distribution.
-
-\verbatim
-foreach(x actions-comm actions-storage app-masterworker app-pingpong app-pmm app-token-ring async-wait async-waitall
- async-waitany cloud-capping cloud-masterworker cloud-migration cloud-multicore cloud-simple
- cloud-two-tasks dht-chord dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm
- platform-failures io-file io-remote io-storage task-priority process-create process-kill process-migration
- process-suspend platform-properties maestro-set process-startkilltime synchro-semaphore trace-categories
- trace-link-srcdst-user-variables trace-link-user-variables trace-masterworker trace-platform
- trace-process-migration trace-user-variables)
- add_executable (${x} ${x}/${x}.c)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
- set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
-endforeach()
-\endverbatim
-
-Some more complex examples may require more than one source file. If it is the case for your example, you will find
-inspiration in the following example
-
-\verbatim
-add_executable (bittorrent app-bittorrent/bittorrent.c app-bittorrent/messages.c app-bittorrent/peer.c app-bittorrent/tracker.c app-bittorrent/connection.c)
-target_link_libraries(bittorrent simgrid)
-set_target_properties(bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
-foreach (file bittorrent connection messages peer tracker)
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.c ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.h)
-endforeach()
-\endverbatim
-
-If your example require a deployment file (see @ref deployment for details), name it as the source file adding "_d.xml".
-Then add the name of your example to this foreach loop.
-
-\verbatim
-foreach (file actions-comm actions-storage app-bittorrent app-chainsend app-masterworker app-pingpong async-wait
- async-waitall async-waitany dht-chord dht-kademlia dht-pastry io-remote platform-properties maestro-set
- task-priority)
- set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml)
-endforeach()
-\endverbatim
-
-If your example includes extra source, text, XML, or tesh files, add them to the existing lists. Finally, register your
-example to the testing infrastructure. See \ref inside_tests_add_integration for more details.
-
-\verbatim
-foreach(x actions-comm actions-storage app-bittorrent app-chainsend app-masterworker app-pingpong app-token-ring
- async-wait async-waitall async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple
- cloud-two-tasks dht-chord dht-kademlia platform-failures io-file io-remote io-storage task-priority
- process-kill process-migration process-suspend platform-properties synchro-semaphore process-startkilltime)
- ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
-endforeach()
-\endverbatim