diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a95e14b65..2b5a38509 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) @@ -881,6 +881,18 @@ 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) |