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
# =====================================================
# ==============================================================================
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}\")
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()