diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 15:08:13 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 15:08:13 +0200 |
commit | b46dbfa63f344cd7e5323139cf71cd100a179682 (patch) | |
tree | 211be3e046dc4b398f7653b78c226d61626e9e68 /CMakeLists.txt | |
parent | 9eb759fc6fa0b41ecfbe366b56384e3eb97dd081 (diff) | |
parent | 57c0b8c1235c5bff3640e85a8e17be20e8f422f3 (diff) | |
download | libnitrokey-b46dbfa63f344cd7e5323139cf71cd100a179682.tar.gz libnitrokey-b46dbfa63f344cd7e5323139cf71cd100a179682.tar.bz2 |
Merge branch 'pr_117'
Library version getter for C API
Fixes #117
Fixes #35
Fixes #62
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dacb48..06ab448 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,9 @@ set(SOURCE_FILES NitrokeyManager.cc NK_C_API.h NK_C_API.cc - DeviceCommunicationExceptions.cpp) + DeviceCommunicationExceptions.cpp + ${CMAKE_CURRENT_BINARY_DIR}/version.cc + ) set(BUILD_SHARED_LIBS ON CACHE BOOL "Build all libraries as shared") add_library(nitrokey ${SOURCE_FILES}) @@ -115,6 +117,11 @@ IF (LOG_VOLATILE_DATA) ENDIF() +# generate version.h +exec_program("git" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --always" OUTPUT_VARIABLE PROJECT_VERSION_GIT) +configure_file("version.cc.in" "version.cc" @ONLY) + + file(GLOB LIB_INCLUDES "libnitrokey/*.h" "NK_C_API.h") install (FILES ${LIB_INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) install (TARGETS nitrokey DESTINATION ${CMAKE_INSTALL_LIBDIR}) |