aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-03-13 09:38:15 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-03-13 09:38:15 +0100
commit86deabd9c8c42412b4467d01b362a8454e5e762f (patch)
treea309ee57b7696a4ffca9a24398e974e9c4bd705a
parent350fa7670ff63d0833d80edee42c1a798c3064c3 (diff)
parentb22b36f89e8924bd5eeef1105ce74a2df4ba02bd (diff)
downloadlibnitrokey-86deabd9c8c42412b4467d01b362a8454e5e762f.tar.gz
libnitrokey-86deabd9c8c42412b4467d01b362a8454e5e762f.tar.bz2
Merge branch 'pr_101'
Fixed header path. Allow to override UDEV rules. Closes #101
-rw-r--r--CMakeLists.txt56
-rw-r--r--NK_C_API.cc6
-rw-r--r--NitrokeyManager.cc8
-rw-r--r--device.cc6
-rw-r--r--libnitrokey/CommandFailedException.h (renamed from include/CommandFailedException.h)0
-rw-r--r--libnitrokey/DeviceCommunicationExceptions.h (renamed from include/DeviceCommunicationExceptions.h)0
-rw-r--r--libnitrokey/LibraryException.h (renamed from include/LibraryException.h)0
-rw-r--r--libnitrokey/LongOperationInProgressException.h (renamed from include/LongOperationInProgressException.h)0
-rw-r--r--libnitrokey/NitrokeyManager.h (renamed from include/NitrokeyManager.h)0
-rw-r--r--libnitrokey/command.h (renamed from include/command.h)0
-rw-r--r--libnitrokey/command_id.h (renamed from include/command_id.h)0
-rw-r--r--libnitrokey/cxx_semantics.h (renamed from include/cxx_semantics.h)0
-rw-r--r--libnitrokey/device.h (renamed from include/device.h)0
-rw-r--r--libnitrokey/device_proto.h (renamed from include/device_proto.h)0
-rw-r--r--libnitrokey/dissect.h (renamed from include/dissect.h)0
-rw-r--r--libnitrokey/hidapi/hidapi.h (renamed from include/hidapi/hidapi.h)0
-rw-r--r--libnitrokey/log.h (renamed from include/log.h)0
-rw-r--r--libnitrokey/misc.h (renamed from include/misc.h)0
-rw-r--r--libnitrokey/stick10_commands.h (renamed from include/stick10_commands.h)0
-rw-r--r--libnitrokey/stick10_commands_0.8.h (renamed from include/stick10_commands_0.8.h)0
-rw-r--r--libnitrokey/stick20_commands.h (renamed from include/stick20_commands.h)0
21 files changed, 39 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6037393..05e20d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,23 +42,23 @@ ENDIF()
MESSAGE("${PROJECT_NAME}: Build type: ${CMAKE_BUILD_TYPE}")
include_directories(hidapi)
-include_directories(include)
+include_directories(libnitrokey)
set(SOURCE_FILES
- include/command.h
- include/command_id.h
- include/cxx_semantics.h
- include/device.h
- include/device_proto.h
- include/dissect.h
- include/log.h
- include/misc.h
- include/NitrokeyManager.h
- include/stick10_commands.h
- include/stick20_commands.h
- include/CommandFailedException.h
- include/LibraryException.h
- include/LongOperationInProgressException.h
- include/stick10_commands_0.8.h
+ libnitrokey/command.h
+ libnitrokey/command_id.h
+ libnitrokey/cxx_semantics.h
+ libnitrokey/device.h
+ libnitrokey/device_proto.h
+ libnitrokey/dissect.h
+ libnitrokey/log.h
+ libnitrokey/misc.h
+ libnitrokey/NitrokeyManager.h
+ libnitrokey/stick10_commands.h
+ libnitrokey/stick20_commands.h
+ libnitrokey/CommandFailedException.h
+ libnitrokey/LibraryException.h
+ libnitrokey/LongOperationInProgressException.h
+ libnitrokey/stick10_commands_0.8.h
command_id.cc
device.cc
log.cc
@@ -115,26 +115,28 @@ IF (LOG_VOLATILE_DATA)
ENDIF()
-file(GLOB LIB_INCLUDES "include/*.h" "NK_C_API.h")
+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})
IF(NOT WIN32)
# Install Nitrokey udev rules
- set(PKG_GET_UDEV_DIR ${PKG_CONFIG_EXECUTABLE} --variable=udevdir udev)
- execute_process(COMMAND ${PKG_GET_UDEV_DIR} RESULT_VARIABLE ERR OUTPUT_VARIABLE UDEV_MAIN_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(${ERR})
- set(UDEV_MAIN_DIR "lib/udev/rules.d")
- ELSE()
- set(UDEV_MAIN_DIR "${UDEV_MAIN_DIR}/rules.d")
+ IF(NOT DEFINED CMAKE_INSTALL_UDEVRULESDIR)
+ set(PKG_GET_UDEV_DIR ${PKG_CONFIG_EXECUTABLE} --variable=udevdir udev)
+ execute_process(COMMAND ${PKG_GET_UDEV_DIR} RESULT_VARIABLE ERR OUTPUT_VARIABLE CMAKE_INSTALL_UDEVRULESDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+ IF(${ERR})
+ set(CMAKE_INSTALL_UDEVRULESDIR "lib/udev/rules.d")
+ ELSE()
+ set(CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}/rules.d")
+ ENDIF()
+ string(REGEX REPLACE "^/" "" CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}")
+ string(REGEX REPLACE "^usr/" "" CMAKE_INSTALL_UDEVRULESDIR "${CMAKE_INSTALL_UDEVRULESDIR}") # usual prefix is usr/local
+ message(STATUS "Setting udev rules dir to ${CMAKE_INSTALL_UDEVRULESDIR}")
ENDIF()
- string(REGEX REPLACE "^/" "" UDEV_MAIN_DIR "${UDEV_MAIN_DIR}")
- string(REGEX REPLACE "^usr/" "" UDEV_MAIN_DIR "${UDEV_MAIN_DIR}") # usual prefix is usr/local
- message(STATUS "Setting udev rules dir to ${UDEV_MAIN_DIR}")
install(FILES
${CMAKE_SOURCE_DIR}/data/41-nitrokey.rules
- DESTINATION ${UDEV_MAIN_DIR}
+ DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR}
)
ENDIF()
diff --git a/NK_C_API.cc b/NK_C_API.cc
index dde150b..64355f5 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -21,10 +21,10 @@
#include "NK_C_API.h"
#include <iostream>
-#include "include/NitrokeyManager.h"
+#include "libnitrokey/NitrokeyManager.h"
#include <cstring>
-#include "include/LibraryException.h"
-#include "include/cxx_semantics.h"
+#include "libnitrokey/LibraryException.h"
+#include "libnitrokey/cxx_semantics.h"
#ifdef _MSC_VER
#ifdef _WIN32
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index e5f10df..db0c0a9 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -21,14 +21,14 @@
#include <cstring>
#include <iostream>
-#include "include/NitrokeyManager.h"
-#include "include/LibraryException.h"
+#include "libnitrokey/NitrokeyManager.h"
+#include "libnitrokey/LibraryException.h"
#include <algorithm>
#include <unordered_map>
#include <stick20_commands.h>
-#include "include/misc.h"
+#include "libnitrokey/misc.h"
#include <mutex>
-#include "include/cxx_semantics.h"
+#include "libnitrokey/cxx_semantics.h"
#include <functional>
#include <stick10_commands.h>
diff --git a/device.cc b/device.cc
index da5345b..da54e33 100644
--- a/device.cc
+++ b/device.cc
@@ -25,9 +25,9 @@
#include <cstddef>
#include <stdexcept>
#include "hidapi/hidapi.h"
-#include "include/misc.h"
-#include "include/device.h"
-#include "include/log.h"
+#include "libnitrokey/misc.h"
+#include "libnitrokey/device.h"
+#include "libnitrokey/log.h"
#include <mutex>
#include "DeviceCommunicationExceptions.h"
#include "device.h"
diff --git a/include/CommandFailedException.h b/libnitrokey/CommandFailedException.h
index 32bd6b7..32bd6b7 100644
--- a/include/CommandFailedException.h
+++ b/libnitrokey/CommandFailedException.h
diff --git a/include/DeviceCommunicationExceptions.h b/libnitrokey/DeviceCommunicationExceptions.h
index f710d0b..f710d0b 100644
--- a/include/DeviceCommunicationExceptions.h
+++ b/libnitrokey/DeviceCommunicationExceptions.h
diff --git a/include/LibraryException.h b/libnitrokey/LibraryException.h
index 3b9d177..3b9d177 100644
--- a/include/LibraryException.h
+++ b/libnitrokey/LibraryException.h
diff --git a/include/LongOperationInProgressException.h b/libnitrokey/LongOperationInProgressException.h
index 865d6b5..865d6b5 100644
--- a/include/LongOperationInProgressException.h
+++ b/libnitrokey/LongOperationInProgressException.h
diff --git a/include/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h
index ca58d24..ca58d24 100644
--- a/include/NitrokeyManager.h
+++ b/libnitrokey/NitrokeyManager.h
diff --git a/include/command.h b/libnitrokey/command.h
index 6852bf0..6852bf0 100644
--- a/include/command.h
+++ b/libnitrokey/command.h
diff --git a/include/command_id.h b/libnitrokey/command_id.h
index 1092ea9..1092ea9 100644
--- a/include/command_id.h
+++ b/libnitrokey/command_id.h
diff --git a/include/cxx_semantics.h b/libnitrokey/cxx_semantics.h
index 36ed142..36ed142 100644
--- a/include/cxx_semantics.h
+++ b/libnitrokey/cxx_semantics.h
diff --git a/include/device.h b/libnitrokey/device.h
index f6d2380..f6d2380 100644
--- a/include/device.h
+++ b/libnitrokey/device.h
diff --git a/include/device_proto.h b/libnitrokey/device_proto.h
index 45a6c16..45a6c16 100644
--- a/include/device_proto.h
+++ b/libnitrokey/device_proto.h
diff --git a/include/dissect.h b/libnitrokey/dissect.h
index 690b5b7..690b5b7 100644
--- a/include/dissect.h
+++ b/libnitrokey/dissect.h
diff --git a/include/hidapi/hidapi.h b/libnitrokey/hidapi/hidapi.h
index e5bc2dc..e5bc2dc 100644
--- a/include/hidapi/hidapi.h
+++ b/libnitrokey/hidapi/hidapi.h
diff --git a/include/log.h b/libnitrokey/log.h
index 2a64bef..2a64bef 100644
--- a/include/log.h
+++ b/libnitrokey/log.h
diff --git a/include/misc.h b/libnitrokey/misc.h
index 88254dd..88254dd 100644
--- a/include/misc.h
+++ b/libnitrokey/misc.h
diff --git a/include/stick10_commands.h b/libnitrokey/stick10_commands.h
index 893b98f..893b98f 100644
--- a/include/stick10_commands.h
+++ b/libnitrokey/stick10_commands.h
diff --git a/include/stick10_commands_0.8.h b/libnitrokey/stick10_commands_0.8.h
index a04946f..a04946f 100644
--- a/include/stick10_commands_0.8.h
+++ b/libnitrokey/stick10_commands_0.8.h
diff --git a/include/stick20_commands.h b/libnitrokey/stick20_commands.h
index 4b75e6a..4b75e6a 100644
--- a/include/stick20_commands.h
+++ b/libnitrokey/stick20_commands.h