]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/yacsloader_swig/Test/CMakeLists.txt
Salome HOME
Use a relative path for the link to the samples directory used by the tests.
[modules/yacs.git] / src / yacsloader_swig / Test / CMakeLists.txt
index 2b7aefabc1bcadfc6f46c8254c72c923918aa680..6cbef482e266ac2c8b08a0cd26e1da5b59de2009 100644 (file)
@@ -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()