]> SALOME platform Git repositories - tools/documentation.git/commitdiff
Salome HOME
bos #24474 Add possibility to create relative symbolic links V9_8_0a1 V9_8_0a2 V9_8_0b1
authorvsr <vsr@opencascade.com>
Fri, 1 Oct 2021 12:24:25 +0000 (15:24 +0300)
committervsr <vsr@opencascade.com>
Fri, 1 Oct 2021 12:25:52 +0000 (15:25 +0300)
CMakeLists.txt
cmake/DocumentationMacros.cmake

index 0472810a575c26a7413c2369b7d79b8bc3dc6c36..9957c65cb5bb14d41271cb37e40ae3340fcf212f 100644 (file)
@@ -56,6 +56,8 @@ INCLUDE(CMakeDependentOption)
 OPTION(SALOME_INSTALL_MODULES_DOC "Install documentation of SALOME modules" OFF)
 CMAKE_DEPENDENT_OPTION(SALOME_CREATE_SYMLINKS "Create symlinks instead of installing docs" OFF
                        "NOT WIN32;SALOME_INSTALL_MODULES_DOC" OFF)
+CMAKE_DEPENDENT_OPTION(SALOME_RELATIVE_SYMLINKS "Make relative symlinks instead of absolute ones" OFF
+                       "NOT WIN32;SALOME_INSTALL_MODULES_DOC;SALOME_CREATE_SYMLINKS" OFF)
 
 # Find prerequisites needed to documentation generation
 # =====================================================
index 6c8cfb36c8a4471e23f1c3c2903cdb340b05129d..51937c0f1d3de56bf221d6993b7241eb472f6f1d 100644 (file)
 # ==============================================================================
 
 MACRO(SALOME_CREATE_SYMLINK src_path link_path)
+  IF(SALOME_RELATIVE_SYMLINKS)
+    FILE(RELATIVE_PATH _link "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${link_path}/.." "${src_path}")
+  ELSE()
+    SET(_link "${src_path}")
+  ENDIF()
   INSTALL(CODE "
           IF(EXISTS \"${src_path}\")
             MESSAGE(STATUS \"Creating symbolic link \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${link_path}\")
@@ -20,7 +25,8 @@ MACRO(SALOME_CREATE_SYMLINK src_path link_path)
             EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory
                     \"\${_path}\")
             EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
-                    \"${src_path}\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${link_path}\")
+                    \"${_link}\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${link_path}\"
+                    WORKING_DIRECTORY \"${_path}\")
           ENDIF()
           ")
 ENDMACRO()