+# Regular examples: with only one source and tested with all factories by default
+#################################################################################
+### Define the examples' specificities
+
+set(_app-bittorrent_sources app-bittorrent/s4u-bittorrent.cpp app-bittorrent/s4u-bittorrent.hpp
+ app-bittorrent/s4u-peer.cpp app-bittorrent/s4u-peer.hpp
+ app-bittorrent/s4u-tracker.cpp app-bittorrent/s4u-tracker.hpp)
+set(_dht-chord_sources dht-chord/s4u-dht-chord.cpp dht-chord/s4u-dht-chord.hpp dht-chord/s4u-dht-chord-node.cpp)
+set(_dht-kademlia_sources dht-kademlia/s4u-dht-kademlia.cpp dht-kademlia/s4u-dht-kademlia.hpp
+ dht-kademlia/node.cpp dht-kademlia/node.hpp
+ dht-kademlia/routing_table.cpp dht-kademlia/routing_table.hpp
+ dht-kademlia/answer.cpp dht-kademlia/answer.hpp dht-kademlia/message.hpp)
+
+set(_actor-stacksize_factories "raw;boost;ucontext") # Threads ignore modifications of the stack size
+
+# The maestro-set example only works for threads and when not using windows.
+set(_maestro-set_factories "thread")
+if(WIN32)
+ set(_maestro-set_disable 1)
+endif()
+
+foreach (example mc-bugged1 mc-bugged2 mc-failing-assert mc-electric-fence)
+ if(NOT SIMGRID_HAVE_MC)
+ set(_${example}_disable 1)
+ endif()
+ set(_${example}_factories "ucontext;raw;boost")
+endforeach()
+
+set(_mc-bugged1-liveness_disable 1)
+if(SIMGRID_HAVE_MC)
+ add_executable (s4u-mc-bugged1-liveness EXCLUDE_FROM_ALL mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
+ target_link_libraries(s4u-mc-bugged1-liveness simgrid)
+ set_target_properties(s4u-mc-bugged1-liveness PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness)
+ add_dependencies(tests s4u-mc-bugged1-liveness)
+ set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
+ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh)
+
+ if(HAVE_C_STACK_CLEANER)
+ add_executable (s4u-mc-bugged1-liveness-cleaner-on EXCLUDE_FROM_ALL s4u-mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
+ target_link_libraries(s4u-mc-bugged1-liveness-cleaner-on simgrid)
+ set_target_properties(s4u-mc-bugged1-liveness-cleaner-on PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fstack-cleaner")
+ add_dependencies(tests s4u-mc-bugged1-liveness-cleaner-on)
+
+ add_executable (s4u-mc-bugged1-liveness-cleaner-off EXCLUDE_FROM_ALL s4u-mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
+ target_link_libraries(s4u-mc-bugged1-liveness-cleaner-off simgrid)
+ set_target_properties(s4u-mc-bugged1-liveness-cleaner-off PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fno-stack-cleaner")
+ add_dependencies(tests s4u-mc-bugged1-liveness-cleaner-off)
+ endif()
+
+endif()
+
+if(SIMGRID_HAVE_NS3)
+ add_executable (s4u-network-ns3 EXCLUDE_FROM_ALL network-ns3/s4u-network-ns3.cpp)
+ target_link_libraries(s4u-network-ns3 simgrid)
+ set_target_properties(s4u-network-ns3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
+ add_dependencies(tests s4u-network-ns3)
+endif()
+
+# Deal with each example