aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 22 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a95e14b65..994d47691 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -435,7 +435,7 @@ if(STATIC AND NOT IOS)
endif()
endif()
-find_package(PCSC)
+find_package(HIDAPI)
add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
add_definition_if_library_exists(c explicit_bzero "strings.h" HAVE_EXPLICIT_BZERO)
@@ -476,14 +476,14 @@ endif()
include_directories(${LIBUNWIND_INCLUDE})
link_directories(${LIBUNWIND_LIBRARY_DIRS})
-# Final setup for libpcsc
-if (PCSC_FOUND)
- message(STATUS "Using PCSC include dir at ${PCSC_INCLUDE_DIR}")
- add_definitions(-DHAVE_PCSC)
- include_directories(${PCSC_INCLUDE_DIR})
- link_directories(${LIBPCSC_LIBRARY_DIRS})
-else (PCSC_FOUND)
- message(STATUS "Could not find PCSC")
+# Final setup for hid
+if (HIDAPI_FOUND)
+ message(STATUS "Using HIDAPI include dir at ${HIDAPI_INCLUDE_DIR}")
+ add_definitions(-DHAVE_HIDAPI)
+ include_directories(${HIDAPI_INCLUDE_DIR})
+ link_directories(${LIBHIDAPI_LIBRARY_DIRS})
+else (HIDAPI_FOUND)
+ message(STATUS "Could not find HIDAPI")
endif()
if(MSVC)
@@ -874,13 +874,25 @@ elseif(DRAGONFLY)
set(EXTRA_LIBRARIES execinfo ${COMPAT})
elseif(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(EXTRA_LIBRARIES socket nsl resolv)
-elseif(NOT MSVC)
+elseif(NOT MSVC AND NOT DEPENDS)
find_library(RT rt)
set(EXTRA_LIBRARIES ${RT})
endif()
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
+if (HIDAPI_FOUND)
+ if (APPLE)
+ find_library(COREFOUNDATION CoreFoundation)
+ find_library(IOKIT IOKit)
+ list(APPEND EXTRA_LIBRARIES ${IOKIT})
+ list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION})
+ endif()
+ if (WIN32)
+ list(APPEND EXTRA_LIBRARIES setupapi)
+ endif()
+endif()
+
option(USE_READLINE "Build with GNU readline support." ON)
if(USE_READLINE)
find_package(Readline)