Skip to content
Snippets Groups Projects
Commit 959e86df authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Proper RPATH for installed projects.

parent 5b8f4582
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
include(UseBackportedModules)
include(OptionRequires)
include(CppcheckTargets)
include(GNUInstallDirs)
include(ProcessorCount)
ProcessorCount(NUM_PROCESSORS)
......
......@@ -34,15 +34,6 @@ elseif(MSVC)
generate_export_header(metis)
endif()
if(BUILD_SHARED_LIBS)
install(TARGETS metis
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
COMPONENT ogs_partmesh
)
endif()
## Compile mpmetis
add_definitions(-DSVNINFO="")
include_directories(${METIS_PATH}/libmetis)
......
......@@ -26,6 +26,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_MACOSX_RPATH 1)
include(GetGitRevisionDescription)
GET_GIT_HEAD_REVISION(GIT_REFSPEC GIT_SHA1)
string(SUBSTRING ${GIT_SHA1} 0 8 GIT_SHA1_SHORT)
......
set(CPACK_GENERATOR TGZ)
# Adds the binaries location to the LD_LIBRARY_PATH
set(CMAKE_INSTALL_RPATH \$ORIGIN/)
if(OGS_USE_CONAN)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
endif()
SET(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
if(MODULE_CMD)
message(STATUS "Found module cmd -> writing module file.")
execute_process(COMMAND ${MODULE_CMD} bash list --terse
execute_process(COMMAND ${MODULE_CMD} bash --terse list
ERROR_VARIABLE MODULE_LIST_OUTPUT
)
string(REPLACE "\n" ";" MODULE_LIST_OUTPUT ${MODULE_LIST_OUTPUT})
......
......@@ -13,9 +13,7 @@ set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_BACKGROUND_IMAGE ${PROJECT_SOURCE_DIR}/Documentation/OpenGeoSys-Logo.png)
set(CPACK_DMG_DS_STORE ${PROJECT_SOURCE_DIR}/scripts/packaging/.DS_Store)
if(OGS_USE_CONAN)
SET(CMAKE_INSTALL_RPATH "@executable_path")
endif()
SET(CMAKE_INSTALL_RPATH "@executable_path;@executable_path/../${CMAKE_INSTALL_LIBDIR}")
if(OGS_BUILD_GUI)
install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment