aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-02-06 12:12:57 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 15:41:44 +0100
commitd93e321832d7e44b76d80d5c13814b7e151d10e9 (patch)
tree46991a864d000529d617e0592071b0651d4c9f89
parent9c24f835372cc28d255557bd00f9d28598a07ebe (diff)
downloadlibnitrokey-d93e321832d7e44b76d80d5c13814b7e151d10e9.tar.gz
libnitrokey-d93e321832d7e44b76d80d5c13814b7e151d10e9.tar.bz2
Use CPack to generate packages
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ed4498..4c37e31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
-cmake_minimum_required(VERSION 3.5)
+SET(PROJECT_VERSION "3.0-alpha")
+cmake_minimum_required(VERSION 3.5)
IF (UNIX)
OPTION(ADD_ASAN "Use ASAN to show memory issues" FALSE)
OPTION(USE_CLANG "Use CLang" FALSE)
@@ -55,6 +56,10 @@ set(SOURCE_FILES
add_library(nitrokey SHARED ${SOURCE_FILES})
target_link_libraries(nitrokey hidapi-libusb)
+install (TARGETS nitrokey DESTINATION "lib")
+file(GLOB LIB_INCLUDES "include/libnitrokey/*.h")
+install (FILES ${LIB_INCLUDES} DESTINATION "include")
+
IF (COMPILE_TESTS)
include_directories(unittest/Catch/include)
@@ -82,3 +87,10 @@ IF (COMPILE_TESTS)
add_test (runs test_C_API)
ENDIF()
+
+# build a CPack driven installer package
+include (InstallRequiredSystemLibraries)
+set (CPACK_RESOURCE_FILE_LICENSE
+ "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+set (CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+include (CPack) \ No newline at end of file