]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
[GITHUB] Fix issue #2: get relative path github/issue-2-relative_path 6/head
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 2 Jul 2024 07:35:29 +0000 (09:35 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 2 Jul 2024 07:35:29 +0000 (09:35 +0200)
cmake/SalomeMacros.cmake

index bb0ab419b0643dc4f17193ddc8a7c6e5e32145a7..ba1cff068c2f95ce063cc1a065b4ba4a077d3da8 100644 (file)
@@ -164,7 +164,7 @@ MACRO(SALOME_INSTALL_SCRIPTS file_list path)
     ENDIF(ext STREQUAL .py)
 
   # get relative path (from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR)
-  STRING(REGEX REPLACE ${CMAKE_SOURCE_DIR} "" rel_dir ${CMAKE_CURRENT_SOURCE_DIR})
+  FILE(RELATIVE_PATH rel_dir ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
   # convert "/" to "_"
   IF(rel_dir)
     STRING(REGEX REPLACE "/" "_" unique_name ${rel_dir})