File: fix-cmake-deps.patch

package info (click to toggle)
reflect-cpp 0.21.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,116 kB
  • sloc: cpp: 50,336; python: 139; makefile: 30; sh: 3
file content (84 lines) | stat: -rw-r--r-- 3,072 bytes parent folder | download
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Description: Fix cmake dependencies
 Use bundled ctre (not packaged now), use correct msgpack library name
Author: Shengqi Chen <harry@debian.org>
Forwarded: not-needed
Last-Update: 2025-02-12 
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,16 +169,16 @@
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
     $<INSTALL_INTERFACE:include>)
 
-if (REFLECTCPP_USE_BUNDLED_DEPENDENCIES)
+#if (REFLECTCPP_USE_BUNDLED_DEPENDENCIES)
     target_include_directories(
         reflectcpp PUBLIC
         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/rfl/thirdparty>)
-else ()
-    if (NOT TARGET ctre::ctre)
-        find_package(ctre CONFIG REQUIRED)
-    endif ()
-    target_link_libraries(reflectcpp PUBLIC ctre::ctre)
-endif ()
+#else ()
+#    if (NOT TARGET ctre::ctre)
+#        find_package(ctre CONFIG REQUIRED)
+#    endif ()
+#    target_link_libraries(reflectcpp PUBLIC ctre::ctre)
+#endif ()
 
 if (_REFLECTCPP_NEEDS_JSON_IMPL)
     list(APPEND REFLECT_CPP_SOURCES
@@ -205,7 +205,6 @@
     list(APPEND REFLECT_CPP_SOURCES
         src/reflectcpp_avro.cpp
     )
-    find_package(jansson CONFIG REQUIRED)
     if (REFLECTCPP_USE_VCPKG)
         target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
         if (MSVC)
@@ -218,27 +217,35 @@
         pkg_check_modules(avro REQUIRED IMPORTED_TARGET avro-c)
         target_link_libraries(reflectcpp PUBLIC PkgConfig::avro)
     endif ()
-    target_link_libraries(reflectcpp PRIVATE jansson::jansson)
 endif ()
 
 if (REFLECTCPP_BSON)
     list(APPEND REFLECT_CPP_SOURCES
         src/reflectcpp_bson.cpp
     )
-    if (NOT TARGET mongo::bson_static AND NOT TARGET mongo::bson_shared)
+    if (NOT TARGET bson::shared)
+        find_package(bson 2.0 CONFIG)
+        if (bson_FOUND)
+            target_link_libraries(reflectcpp PUBLIC bson::shared)
+        endif ()
+    endif ()
+    if (NOT bson_FOUND AND NOT TARGET mongo::bson_shared)
         find_package(bson-1.0 CONFIG REQUIRED)
+	target_link_libraries(reflectcpp PUBLIC mongo::bson_shared)
     endif ()
-    target_link_libraries(reflectcpp PUBLIC $<IF:$<TARGET_EXISTS:mongo::bson_static>,mongo::bson_static,mongo::bson_shared>)
 endif ()
 
 if (REFLECTCPP_CAPNPROTO)
     list(APPEND REFLECT_CPP_SOURCES
         src/reflectcpp_capnproto.cpp
     )
-    if (NOT TARGET CapnProto)
-        find_package(CapnProto CONFIG REQUIRED)
-    endif ()
-     target_link_libraries(reflectcpp PUBLIC CapnProto::kj CapnProto::capnp CapnProto::capnpc CapnProto::kj-gzip)
+    # if (NOT TARGET CapnProto)
+        # find_package(CapnProto CONFIG REQUIRED) # see bug #1095942
+    # endif ()
+    # target_link_libraries(reflectcpp PUBLIC CapnProto::kj CapnProto::capnp CapnProto::capnpc CapnProto::kj-gzip)
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(capnp REQUIRED IMPORTED_TARGET capnp kj capnpc kj-gzip)
+    target_link_libraries(reflectcpp PUBLIC PkgConfig::capnp)
 endif ()
 
 if (REFLECTCPP_CBOR)