Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Out of sources build for those examples.
[simgrid.git] / teshsuite / gras / small_sleep / CMakeLists.txt
index 3684c2c..3b6cffb 100644 (file)
@@ -1,14 +1,28 @@
 cmake_minimum_required(VERSION 2.6)
 
-set_source_files_properties(_small_sleep_function.c _small_sleep_simulator.c
-PROPERTIES GENERATED true)
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c
+                                                       ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c
+                                                       PROPERTIES GENERATED true)
 
-set(EXECUTABLE_OUTPUT_PATH "./")
-set(LIBRARY_OUTPUT_PATH "${PROJECT_DIRECTORY}/lib")
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
-add_executable(small_sleep_function    small_sleep.c _small_sleep_function.c)
-add_executable(small_sleep_simulator   small_sleep.c _small_sleep_simulator.c)
+add_executable(small_sleep_function    ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.c
+                                                                               ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c)
+add_executable(small_sleep_simulator   ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.c
+                                                                               ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c)
 
+add_custom_command(
+                                       OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c
+                                                       ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c
+                                       DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.xml
+                                       COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator small_sleep ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.xml
+                                       )
+                                       
 ### Add definitions for compile
-target_link_libraries(small_sleep_simulator simgrid m pthread -fprofile-arcs)
-target_link_libraries(small_sleep_function gras m pthread -fprofile-arcs)
+if(NOT WIN32)
+target_link_libraries(small_sleep_simulator simgrid m pthread)
+target_link_libraries(small_sleep_function gras m pthread)
+else(NOT WIN32)
+target_link_libraries(small_sleep_simulator simgrid)
+target_link_libraries(small_sleep_function gras)
+endif(NOT WIN32)
\ No newline at end of file