+# These tests are cpp (by default, we assume C code)
+set(_replay_sources ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.cpp)
+set(_ampi_test_sources ${CMAKE_CURRENT_SOURCE_DIR}/ampi_test/ampi_test.cpp)
+
+# These tests are only used when MC is actived
+set(MC_tests bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1
+ non_termination2 non_termination3 non_termination4 sendsend)
+foreach(x ${MC_tests})
+ if(NOT SIMGRID_HAVE_STATEFUL_MC)
+ set(_${x}_disable 1)
+ endif()
+ set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c)
+ set(_${x}_outdir ${CMAKE_CURRENT_BINARY_DIR}/mc)
+endforeach()
+
+# Compute the default for all configurations, and add all source files to the archive
+foreach(x ampi_test trace trace_simple trace_call_location energy gemm simple-execute replay ${MC_tests})
+ if(NOT DEFINED _${x}_sources)
+ set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
+ endif()
+ if(NOT DEFINED _${x}_outdir)
+ set(_${x}_outdir ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ endif()
+
+ set(examples_src ${examples_src} ${_${x}_sources})
+endforeach()
+set(examples_src ${examples_src} PARENT_SCOPE)
+
+# Compile the binaries, but only when everything is activated