aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-14 17:51:45 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-14 17:54:07 +0100
commit4c0409c5a2d5abeafb8b115876791ab74440c577 (patch)
tree2e23cc14cca8bb55533720f9a894cf1e08859582 /CMakeLists.txt
parentcbf6cbbfcb4e8b8273b8ca551b687ffd9e7378f7 (diff)
downloadlibnitrokey-4c0409c5a2d5abeafb8b115876791ab74440c577.tar.gz
libnitrokey-4c0409c5a2d5abeafb8b115876791ab74440c577.tar.bz2
Do not link hidapi under OSX
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46405a9..1dcffb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,10 @@ set(SOURCE_FILES
NK_C_API.cc
DeviceCommunicationExceptions.cpp)
-IF(UNIX)
+IF(APPLE)
+ #include_directories(hidapi/hidapi)
+ #add_library(hidapi-libusb STATIC hidapi/mac/hid.c )
+ELSEIF(UNIX)
# add_library(hidapi-libusb STATIC hidapi/libusb/hid.c )
ELSEIF(WIN32)
include_directories(hidapi/hidapi)
@@ -80,8 +83,11 @@ ELSE()
add_library(nitrokey-static-log STATIC ${SOURCE_FILES})
SET(LIBNAME nitrokey-static)
ENDIF()
-target_link_libraries(${LIBNAME} hidapi-libusb)
-target_link_libraries(${LIBNAME}-log hidapi-libusb)
+
+IF(NOT APPLE)
+ target_link_libraries(${LIBNAME} hidapi-libusb)
+ target_link_libraries(${LIBNAME}-log hidapi-libusb)
+ENDIF()
SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_DEFINITIONS "NO_LOG")
@@ -124,4 +130,4 @@ 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
+include (CPack)