aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-24 22:19:48 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-24 22:19:49 +0200
commit59024a9e889897faf34c03961ead49e32ec1e92b (patch)
tree7c6e03ce2a27685b09bf65a06536113d954b574e /CMakeLists.txt
parentMerge pull request #4429 (diff)
parentReplace USB-CCID (smartcard) by USB-HID (diff)
downloadmonero-59024a9e889897faf34c03961ead49e32ec1e92b.tar.xz
Merge pull request #4203
bb6e3bbc Replace USB-CCID (smartcard) by USB-HID (cslashm)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
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)