-add_executable (master_worker_vm master_worker_vm.c)
-target_link_libraries(master_worker_vm simgrid)
-add_executable (simple_vm simple_vm.c)
-target_link_libraries(simple_vm simgrid)
-add_executable (migrate_vm migrate_vm.c)
-target_link_libraries(migrate_vm simgrid)
-add_executable (bound bound.c)
-target_link_libraries(bound simgrid)
-add_executable (scale scale.c)
-target_link_libraries(scale simgrid)
-add_executable (multicore multicore.c)
-target_link_libraries(multicore simgrid)
-add_executable (two_tasks_vm two_tasks_vm.c)
-target_link_libraries(two_tasks_vm simgrid)
+foreach (example master_worker_vm simple_vm migrate_vm bound scale multicore two_tasks_vm)
+ add_executable (${example} ${example}.c)
+ target_link_libraries(${example} simgrid)
+ set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.c)
+endforeach()