diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f8aa8b..1f5e651 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -170,7 +170,13 @@ if(UNIX)
 endif()
 
 
-if(MSVC)
+find_package(libcbor CONFIG REQUIRED)
+set(CBOR_LIBRARIES libcbor::libcbor)
+find_package(ZLIB REQUIRED)
+set(ZLIB_LIBRARIES ZLIB::ZLIB)
+find_package(OpenSSL REQUIRED)
+set(CRYPTO_LIBRARIES OpenSSL::Crypto)
+if(0)
 	if((NOT CBOR_INCLUDE_DIRS) OR (NOT CBOR_LIBRARY_DIRS) OR
 	   (NOT CRYPTO_INCLUDE_DIRS) OR (NOT CRYPTO_LIBRARY_DIRS) OR
 	   (NOT ZLIB_INCLUDE_DIRS) OR (NOT ZLIB_LIBRARY_DIRS))
@@ -195,7 +201,7 @@ if(MSVC)
 	if(NOT CRYPTO_DLL)
 		set(CRYPTO_DLL crypto)
 	endif()
-
+elseif(MSVC)
 	set(MSVC_DISABLED_WARNINGS_LIST
 		"C4152" # nonstandard extension used: function/data pointer
 			# conversion in expression;
@@ -221,7 +227,7 @@ if(MSVC)
 		add_definitions(-DUSE_WINHELLO)
 	endif()
 	set(NFC_LINUX OFF)
-else()
+elseif(0)
 	include(FindPkgConfig)
 	pkg_search_module(CBOR libcbor)
 	pkg_search_module(CRYPTO libcrypto)
@@ -243,7 +249,7 @@ else()
 	if(NOT CRYPTO_LIBRARIES)
 		set(CRYPTO_LIBRARIES "crypto")
 	endif()
-
+elseif(1)
 	if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
 		pkg_search_module(UDEV libudev REQUIRED)
 		set(UDEV_NAME "udev")
diff --git a/src/libfido2.pc.in b/src/libfido2.pc.in
index 03d0606..1a299ae 100644
--- a/src/libfido2.pc.in
+++ b/src/libfido2.pc.in
@@ -7,6 +7,6 @@ Name: @PROJECT_NAME@
 Description: A FIDO2 library
 URL: https://github.com/yubico/libfido2
 Version: @FIDO_VERSION@
-Requires: libcrypto
+Requires.private: libcrypto libcbor zlib
 Libs: -L${libdir} -lfido2
 Cflags: -I${includedir}
