mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Optionally enable system installation of binaries
If the option PRIVATE_INSTALL is set to OFF, LSB-compliant paths are used for the `install' target.
This commit is contained in:
parent
3fcd05e838
commit
e7613fe9ee
@ -266,6 +266,9 @@ set (RESINSIGHT_LICENSE_FILES
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/Adm/gplLicense.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/Adm/gplLicense.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# bundle libraries together with private installation
|
||||||
|
if (PRIVATE_INSTALL)
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
# tell binary to first attempt to load libraries from its own directory
|
# tell binary to first attempt to load libraries from its own directory
|
||||||
set_target_properties (ResInsight PROPERTIES INSTALL_RPATH "\$ORIGIN")
|
set_target_properties (ResInsight PROPERTIES INSTALL_RPATH "\$ORIGIN")
|
||||||
@ -303,3 +306,14 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resinsight DESTINATION ${RESINSIGHT_FINAL_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resinsight DESTINATION ${RESINSIGHT_FINAL_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
else (PRIVATE_INSTALL)
|
||||||
|
# binaries go in /usr/bin
|
||||||
|
install (TARGETS ResInsight
|
||||||
|
DESTINATION bin
|
||||||
|
)
|
||||||
|
# license go in /usr/share/doc
|
||||||
|
install (FILES ${RESINSIGHT_LICENSE_FILES}
|
||||||
|
DESTINATION share/doc/ResInsight
|
||||||
|
)
|
||||||
|
# no bundled libraries for system install
|
||||||
|
endif (PRIVATE_INSTALL)
|
||||||
|
@ -114,8 +114,12 @@ if (NOT "${RESINSIGHT_PLATFORM}" STREQUAL "")
|
|||||||
set (RESINSIGHT_FINAL_NAME "${RESINSIGHT_FINAL_NAME}-${RESINSIGHT_PLATFORM}")
|
set (RESINSIGHT_FINAL_NAME "${RESINSIGHT_FINAL_NAME}-${RESINSIGHT_PLATFORM}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# override system install prefix if private installation chosen
|
||||||
|
option (PRIVATE_INSTALL "Install in a private directory" ON)
|
||||||
|
if (PRIVATE_INSTALL)
|
||||||
set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install/)
|
set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install/)
|
||||||
#set (CMAKE_INSTALL_PREFIX /usr/${RESINSIGHT_FINAL_NAME})
|
#set (CMAKE_INSTALL_PREFIX /usr/${RESINSIGHT_FINAL_NAME})
|
||||||
|
endif (PRIVATE_INSTALL)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Application
|
# Application
|
||||||
|
Loading…
Reference in New Issue
Block a user