Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Tasks must be initialized.
[simgrid.git] / examples / simdag / CMakeLists.txt
index 56f28b0..ce683e9 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
 cmake_minimum_required(VERSION 2.6)
 
-set(EXECUTABLE_OUTPUT_PATH "${PROJECT_DIRECTORY}/examples/simdag/")
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
 add_executable(ex_sd_test sd_test.c)
 add_executable(sd_test2 sd_test2.c)
 
 add_executable(ex_sd_test sd_test.c)
 add_executable(sd_test2 sd_test2.c)
@@ -18,13 +18,13 @@ if(NOT WIN32)
        
        add_custom_command(TARGET ex_sd_test
                POST_BUILD
        
        add_custom_command(TARGET ex_sd_test
                POST_BUILD
-               COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/examples/simdag/ex_sd_test ${PROJECT_DIRECTORY}/examples/simdag/sd_test
-               WORKING_DIRECTORY "${PROJECT_DIRECTORY}/examples/simdag/"
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/ex_sd_test ${CMAKE_CURRENT_BINARY_DIR}/sd_test
+               WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
        )
        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
        set_directory_properties(
         PROPERTIES
        )
        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
        set_directory_properties(
         PROPERTIES
-        ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/examples/simdag/sd_test")
+        ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${CMAKE_CURRENT_BINARY_DIR}/sd_test")
  
 else(NOT WIN32)
        target_link_libraries(ex_sd_test simgrid)
  
 else(NOT WIN32)
        target_link_libraries(ex_sd_test simgrid)
@@ -35,12 +35,12 @@ else(NOT WIN32)
        
        add_custom_command(TARGET ex_sd_test
                POST_BUILD
        
        add_custom_command(TARGET ex_sd_test
                POST_BUILD
-               COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/examples/simdag/ex_sd_test.exe ${PROJECT_DIRECTORY}/examples/simdag/sd_test.exe
-               WORKING_DIRECTORY "${PROJECT_DIRECTORY}/examples/simdag/"
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/ex_sd_test.exe ${CMAKE_CURRENT_BINARY_DIR}/sd_test.exe
+               WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
        )
        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
        set_directory_properties(
         PROPERTIES
        )
        get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
        set_directory_properties(
         PROPERTIES
-        ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/examples/simdag/sd_test.exe")
+        ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${CMAKE_CURRENT_BINARY_DIR}/sd_test.exe")
 endif(NOT WIN32)
 
 endif(NOT WIN32)