From 81c571783673c794dfd12682a5b9db490cff2a99 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 12 Jan 2019 21:39:59 +0100 Subject: [PATCH] The tests also need smpimain and smpireplaymain They also need the simgrid library, but this is automatically detected by cmake since the test binaries are linked against this lib. --- CMakeLists.txt | 2 ++ tools/cmake/MakeLib.cmake | 2 ++ tools/cmake/Tests.cmake | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 850f75f30f..ee19db8a14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,6 +756,8 @@ include(${CMAKE_HOME_DIRECTORY}/tools/cmake/DefinePackages.cmake) include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake) include(${CMAKE_HOME_DIRECTORY}/tools/cmake/UnitTesting.cmake) +add_custom_target(tests COMMENT "Recompiling the tests") + ### Make Libs if(NOT WIN32) include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake) diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index b1ea27d06b..ce355d31dd 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -101,6 +101,7 @@ if(enable_smpi) PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/simgrid) install(TARGETS smpimain # install that binary without breaking the rpath on Mac RUNTIME DESTINATION lib/simgrid) + add_dependencies(tests smpimain) add_executable(smpireplaymain src/smpi/smpi_replay_main.cpp) target_compile_options(smpireplaymain PRIVATE -fpic) @@ -109,6 +110,7 @@ if(enable_smpi) PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/simgrid) install(TARGETS smpireplaymain # install that binary without breaking the rpath on Mac RUNTIME DESTINATION lib/simgrid) + add_dependencies(tests smpireplaymain) if(SMPI_FORTRAN) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 05c1c5432a..d0200dddf9 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -1,5 +1,3 @@ -add_custom_target(tests COMMENT "Recompiling the tests") - IF(enable_smpi AND NOT WIN32) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicxx) -- 2.20.1