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

index 2b7a36d958c2dcb652ec32547fd69a640aa902cb..3d30facec24d1846346fa42e1e5070c8f2e42eaa 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})