From 4c0409c5a2d5abeafb8b115876791ab74440c577 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 14 Mar 2017 17:51:45 +0100 Subject: Do not link hidapi under OSX Signed-off-by: Szczepan Zalega --- CMakeLists.txt | 14 ++++++++++---- 1 file 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) -- cgit v1.2.3