mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #15 from rolk/instdir
Enable installation of ResInsight with a package manager through an option
This commit is contained in:
commit
74a1cdd889
@ -261,8 +261,17 @@ endif(MSVC)
|
||||
# Install
|
||||
#############################################################################
|
||||
|
||||
set (RESINSIGHT_LICENSE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Adm/LicenseInformation.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Adm/gplLicense.txt
|
||||
)
|
||||
|
||||
# bundle libraries together with private installation
|
||||
if (PRIVATE_INSTALL)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set_target_properties(ResInsight PROPERTIES INSTALL_RPATH "${RESINSIGHT_FINAL_INSTALL_PATH};.")
|
||||
# tell binary to first attempt to load libraries from its own directory
|
||||
set_target_properties (ResInsight PROPERTIES INSTALL_RPATH "\$ORIGIN")
|
||||
|
||||
# Find Qt libraries and sym links
|
||||
file (GLOB RESINSIGHT_FILES
|
||||
@ -275,6 +284,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
# put a .exe.local file in the target directory to pick up DLLs from there
|
||||
install (CODE "exec_program (${CMAKE_COMMAND} ARGS -E touch \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}${RESINSIGHT_FINAL_NAME}/ResInsight${CMAKE_EXECUTABLE_SUFFIX}.local)")
|
||||
|
||||
set (RESINSIGHT_FILES
|
||||
${QT_BINARY_DIR}/QtCore4.dll
|
||||
${QT_BINARY_DIR}/QtGui4.dll
|
||||
@ -283,10 +295,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
)
|
||||
endif()
|
||||
|
||||
set (RESINSIGHT_FILES ${RESINSIGHT_FILES}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Adm/LicenseInformation.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Adm/gplLicense.txt
|
||||
)
|
||||
set (RESINSIGHT_FILES ${RESINSIGHT_FILES} ${RESINSIGHT_LICENSE_FILES})
|
||||
|
||||
|
||||
install(TARGETS ResInsight DESTINATION ${RESINSIGHT_FINAL_NAME})
|
||||
@ -297,3 +306,29 @@ 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 )
|
||||
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
|
||||
# application icon
|
||||
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/AppLogo48x48.png
|
||||
DESTINATION share/icons/hicolor/48x48/apps
|
||||
RENAME ResInsight.png
|
||||
)
|
||||
# desktop environment icon; remember to call `update-desktop-database`
|
||||
# in package post-install scripts
|
||||
configure_file (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/resinsight.desktop.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/resinsight.desktop
|
||||
@ONLY
|
||||
)
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/resinsight.desktop
|
||||
DESTINATION share/applications
|
||||
)
|
||||
endif (PRIVATE_INSTALL)
|
||||
|
10
ApplicationCode/resinsight.desktop.in
Normal file
10
ApplicationCode/resinsight.desktop.in
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
Icon=@CMAKE_INSTALL_PREFIX@/share/icons/hicolor/48x48/apps/ResInsight.png
|
||||
ame=ResInsight
|
||||
Comment=3D viewer and post processing tool for reservoir models
|
||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/ResInsight
|
||||
Categories=Applications;Science;
|
@ -114,10 +114,12 @@ if (NOT "${RESINSIGHT_PLATFORM}" STREQUAL "")
|
||||
set (RESINSIGHT_FINAL_NAME "${RESINSIGHT_FINAL_NAME}-${RESINSIGHT_PLATFORM}")
|
||||
endif()
|
||||
|
||||
set (RESINSIGHT_FINAL_INSTALL_PATH "/usr/${RESINSIGHT_FINAL_NAME}")
|
||||
|
||||
# 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 ${RESINSIGHT_FINAL_INSTALL_PATH})
|
||||
#set (CMAKE_INSTALL_PREFIX /usr/${RESINSIGHT_FINAL_NAME})
|
||||
endif (PRIVATE_INSTALL)
|
||||
|
||||
################################################################################
|
||||
# Application
|
||||
|
@ -8,7 +8,8 @@ set(CPP_SOURCES
|
||||
)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(RPATH_COMMAND "-Wl,-rpath=${RESINSIGHT_FINAL_INSTALL_PATH} -Wl,-rpath=.")
|
||||
# since the compiler passes the option to the linker, double quoting is necessary
|
||||
set (RPATH_COMMAND "-Wl,-rpath,'\\$$ORIGIN'")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
@ -103,4 +104,23 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if (PRIVATE_INSTALL)
|
||||
install(FILES ${OCTAVE_BINARY_OCT_FILES} DESTINATION ${RESINSIGHT_FINAL_NAME})
|
||||
else (PRIVATE_INSTALL)
|
||||
# probe for site location of .oct files
|
||||
if (NOT OCTAVE_SITE_OCT_DIR)
|
||||
find_program (OCTAVE_CONFIG_COMMAND
|
||||
octave-config
|
||||
DOC "Path to Octave component and library information retrieval"
|
||||
)
|
||||
exec_program (${OCTAVE_CONFIG_COMMAND}
|
||||
ARGS --oct-site-dir
|
||||
OUTPUT_VARIABLE OCTAVE_SITE_OCT_DIR
|
||||
)
|
||||
set (OCTAVE_SITE_OCT_DIR "${OCTAVE_SITE_OCT_DIR}" CACHE LOCATION "Octave plugin directory")
|
||||
endif (NOT OCTAVE_SITE_OCT_DIR)
|
||||
|
||||
install (FILES ${OCTAVE_BINARY_OCT_FILES}
|
||||
DESTINATION ${OCTAVE_SITE_OCT_DIR}
|
||||
)
|
||||
endif (PRIVATE_INSTALL)
|
||||
|
Loading…
Reference in New Issue
Block a user