48 lines
1.7 KiB
Diff
48 lines
1.7 KiB
Diff
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index 11a51ac..33b9313 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -156,18 +156,20 @@ if(UNIX)
|
||
|
endif()
|
||
|
|
||
|
if(MSVC)
|
||
|
- if((NOT CBOR_INCLUDE_DIRS) OR (NOT CBOR_LIBRARY_DIRS) OR
|
||
|
- (NOT CBOR_BIN_DIRS) OR (NOT CRYPTO_INCLUDE_DIRS) OR
|
||
|
- (NOT CRYPTO_LIBRARY_DIRS) OR (NOT CRYPTO_BIN_DIRS) OR
|
||
|
- (NOT ZLIB_INCLUDE_DIRS) OR (NOT ZLIB_LIBRARY_DIRS) OR
|
||
|
- (NOT ZLIB_BIN_DIRS))
|
||
|
- message(FATAL_ERROR "please define "
|
||
|
- "{CBOR,CRYPTO,ZLIB}_{INCLUDE,LIBRARY,BIN}_DIRS when "
|
||
|
- "building under msvc")
|
||
|
- endif()
|
||
|
- set(CBOR_LIBRARIES cbor)
|
||
|
- set(ZLIB_LIBRARIES zlib)
|
||
|
- set(CRYPTO_LIBRARIES crypto-47)
|
||
|
+ find_package(PkgConfig)
|
||
|
+
|
||
|
+ find_package(LIBCBOR REQUIRED)
|
||
|
+ find_package(OpenSSL REQUIRED)
|
||
|
+ find_package(ZLIB REQUIRED)
|
||
|
+
|
||
|
+ # Handling of different Packagenames in VCPKG
|
||
|
+ set(CBOR_INCLUDE_DIRS ${LIBCBOR_INCLUDE_DIR})
|
||
|
+ set(CRYPTO_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIRS})
|
||
|
+ set(CBOR_LIBRARY_DIRS ${LIBCBOR_LIBRARY_DIRS})
|
||
|
+ set(CRYPTO_LIBRARY_DIRS ${OPENSSL_LIBRARY_DIRS})
|
||
|
+ set(CBOR_LIBRARIES ${LIBCBOR_LIBRARIES})
|
||
|
+ set(CRYPTO_LIBRARIES ${OPENSSL_LIBRARIES})
|
||
|
+ add_definitions("-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_NONSTDC_NO_DEPRECATE")
|
||
|
set(MSVC_DISABLED_WARNINGS_LIST
|
||
|
"C4152" # nonstandard extension used: function/data pointer
|
||
|
# conversion in expression;
|
||
|
@@ -403,6 +402,9 @@ message(STATUS "USE_HIDAPI: ${USE_HIDAPI}")
|
||
|
message(STATUS "USE_WINHELLO: ${USE_WINHELLO}")
|
||
|
message(STATUS "NFC_LINUX: ${NFC_LINUX}")
|
||
|
|
||
|
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996")
|
||
|
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
|
||
|
+
|
||
|
subdirs(src)
|
||
|
if(BUILD_EXAMPLES)
|
||
|
subdirs(examples)
|