summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-02-06 17:17:28 +0100
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-02-06 18:27:38 +0100
commit544ad6f9759de6acc109307caee2100478cba8ed (patch)
treeeec4c0c26142f945f9540ed6e37f6e26173e3672 /CMakeLists.txt
parentc80de3a96b4d91b1202d9ebebab11f6ff0af2045 (diff)
downloadouroboros-544ad6f9759de6acc109307caee2100478cba8ed.tar.gz
ouroboros-544ad6f9759de6acc109307caee2100478cba8ed.zip
build: Use GNUInstallDirs instead of hardcoded values0.9.9
This changes the build to use GNUInstallDirs instead of hardcoded values. Package maintainers can then override these defaults by passing the correct value to cmake on the command line. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8f946bd..c5ea3bf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,14 +22,14 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "/" CACHE STRING "Installation Prefix" FORCE)
+ set(CMAKE_INSTALL_PREFIX "/usr" CACHE STRING "Installation Prefix" FORCE)
endif ()
if (APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()
-if (CMAKE_INSTALL_PREFIX STREQUAL "/")
+if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
set(RPATH_PREFIX "")
else ()
set(RPATH_PREFIX ${CMAKE_INSTALL_PREFIX})
@@ -40,9 +40,9 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- "${RPATH_PREFIX}/usr/lib" isSystemDir)
+ "${RPATH_PREFIX}/lib" isSystemDir)
IF ("${isSystemDir}" STREQUAL "-1")
- set(CMAKE_INSTALL_RPATH "${RPATH_PREFIX}/usr/lib")
+ set(CMAKE_INSTALL_RPATH "${RPATH_PREFIX}/lib")
ENDIF ("${isSystemDir}" STREQUAL "-1")
message(STATUS "Package name is: ${PACKAGE_NAME}")
@@ -101,17 +101,17 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros-irm.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/ouroboros-irm.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros-dev.pc"
- DESTINATION "usr/lib/pkgconfig")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros-irm.pc"
- DESTINATION "usr/lib/pkgconfig")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
if (IS_DIRECTORY "/usr/lib/systemd")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/irmd.service.in"
"${CMAKE_CURRENT_BINARY_DIR}/irmd.service" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/irmd.service"
- DESTINATION "usr/lib/systemd/system")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/system")
endif ()
enable_testing()