aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/jwt-cpp/picojson_from_vcpkg.patch
blob: f8086fc569d347b412c1fce08a126c5e3190fe9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2520e4e..93034ef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,7 +70,7 @@ elseif(${JWT_SSL_LIBRARY} MATCHES "wolfSSL")
 endif()
 
 if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)
-  find_package(picojson 1.3.0 REQUIRED)
+  find_path(PICOJSON_INCLUDE_DIR "picojson/picojson.h" REQUIRED)
 endif()
 
 if(JWT_BUILD_EXAMPLES OR JWT_BUILD_TESTS)
@@ -132,7 +132,7 @@ if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL")
 endif()
 
 if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)
-  target_link_libraries(jwt-cpp INTERFACE picojson::picojson>)
+  target_include_directories(jwt-cpp INTERFACE "${PICOJSON_INCLUDE_DIR}")
 endif()
 
 # Hunter needs relative paths so the files are placed correctly
diff --git a/cmake/jwt-cpp-config.cmake.in b/cmake/jwt-cpp-config.cmake.in
index d0e7cd0..ba563a2 100644
--- a/cmake/jwt-cpp-config.cmake.in
+++ b/cmake/jwt-cpp-config.cmake.in
@@ -13,8 +13,4 @@ else()
   find_dependency(${JWT_SSL_LIBRARY} REQUIRED)
 endif()
 
-if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)
-  find_dependency(picojson REQUIRED)
-endif()
-
 include("${CMAKE_CURRENT_LIST_DIR}/jwt-cpp-targets.cmake")