From: Ovidiu Mircescu Date: Mon, 21 Sep 2015 09:48:19 +0000 (+0200) Subject: Use a relative path for the link to the samples directory used by the tests. X-Git-Tag: V7_7_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e39f85fa9781be34e995b38fbb25b6c888b0b7f0;p=modules%2Fyacs.git Use a relative path for the link to the samples directory used by the tests. This is done in order to allow the copy of the installation directory. --- diff --git a/src/yacsloader/Test/CMakeLists.txt b/src/yacsloader/Test/CMakeLists.txt index 8c5f73d14..4eb22cd41 100644 --- a/src/yacsloader/Test/CMakeLists.txt +++ b/src/yacsloader/Test/CMakeLists.txt @@ -135,7 +135,15 @@ IF(NOT WIN32) DESTINATION ${LOCAL_TEST_DIR}) INSTALL(PROGRAMS runYacsLoaderTest.sh ${CMAKE_CURRENT_BINARY_DIR}/xmlrun.sh DESTINATION ${LOCAL_TEST_DIR}) + # Use relative path for symbolic links in order to allow the copy of the directory. + # REL_PATH_TO_INSTALL goes to CMAKE_INSTALL_PREFIX from ${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR} + IF(IS_ABSOLUTE ${SALOME_YACS_INSTALL_SAMPLES}) + SET(SAMPLES_LINK_TARGET ${SALOME_YACS_INSTALL_SAMPLES}) + ELSE() + STRING(REGEX REPLACE [^/]+ ".." REL_PATH_TO_INSTALL ${LOCAL_TEST_DIR}) + SET(SAMPLES_LINK_TARGET ${REL_PATH_TO_INSTALL}/${SALOME_YACS_INSTALL_SAMPLES}) + ENDIF() INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_INSTALL_PREFIX}/${SALOME_YACS_INSTALL_SAMPLES} + ${SAMPLES_LINK_TARGET} ${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR}/samples )" ) ENDIF() diff --git a/src/yacsloader_swig/Test/CMakeLists.txt b/src/yacsloader_swig/Test/CMakeLists.txt index 2b7aefabc..6cbef482e 100644 --- a/src/yacsloader_swig/Test/CMakeLists.txt +++ b/src/yacsloader_swig/Test/CMakeLists.txt @@ -52,7 +52,15 @@ IF(NOT WIN32) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + # Use relative path for symbolic links in order to allow the copy of the directory. + # REL_PATH_TO_INSTALL goes to CMAKE_INSTALL_PREFIX from ${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR} + IF(IS_ABSOLUTE ${SALOME_YACS_INSTALL_SAMPLES}) + SET(SAMPLES_LINK_TARGET ${SALOME_YACS_INSTALL_SAMPLES}) + ELSE() + STRING(REGEX REPLACE [^/]+ ".." REL_PATH_TO_INSTALL ${LOCAL_TEST_DIR}) + SET(SAMPLES_LINK_TARGET ${REL_PATH_TO_INSTALL}/${SALOME_YACS_INSTALL_SAMPLES}) + ENDIF() INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_INSTALL_PREFIX}/${SALOME_YACS_INSTALL_SAMPLES} + ${SAMPLES_LINK_TARGET} ${CMAKE_INSTALL_PREFIX}/${LOCAL_TEST_DIR}/samples )" ) ENDIF()