summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorIgor Gnatenko <ignatenkobrain@fedoraproject.org>2017-10-07 09:44:51 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-10-07 10:57:41 +0200
commitbb590b172f0d90fddd6187d78b4ffea5601b0561 (patch)
treec392e0419a9990169f8e62e6e2af51ac0a82d3f9 /CMakeLists.txt
parent7f7cfeb45b579204e0bc94bea37e2c810d2e5ec9 (diff)
downloadlibnitrokey-bb590b172f0d90fddd6187d78b4ffea5601b0561.tar.gz
libnitrokey-bb590b172f0d90fddd6187d78b4ffea5601b0561.tar.bz2
build: use GNUInstallDirs
This simplifies package maintainers life a lot so they don't have to patch buildsystem at all. It just works. Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11882f9..cd18827 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,8 @@ project(libnitrokey)
SET(PROJECT_VERSION "3.0-alpha")
set(CMAKE_CXX_STANDARD 14)
+include(GNUInstallDirs)
+
OPTION(LIBNITROKEY_STATIC "Build libnitrokey statically" TRUE)
@@ -84,7 +86,7 @@ ENDIF()
IF (NOT LIBNITROKEY_STATIC)
add_library(nitrokey SHARED ${SOURCE_FILES})
add_library(nitrokey-log SHARED ${SOURCE_FILES})
- install (TARGETS nitrokey DESTINATION "lib")
+ install (TARGETS nitrokey DESTINATION ${CMAKE_INSTALL_LIBDIR})
SET(LIBNAME nitrokey)
ELSE()
add_library(nitrokey-static STATIC ${SOURCE_FILES})
@@ -111,7 +113,7 @@ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_DEFINITIONS "NO_LOG")
file(GLOB LIB_INCLUDES "include/libnitrokey/*.h")
-install (FILES ${LIB_INCLUDES} DESTINATION "include")
+install (FILES ${LIB_INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
IF (COMPILE_TESTS)
include_directories(unittest/Catch/include)