projects/aports·blob master · refs

35 lines · 1.2 KiB

1Patch-Source: https://github.com/organicmaps/organicmaps/pull/7982
2---
3From 905b161487865a200ce4a43fb2c1d96ecb38e102 Mon Sep 17 00:00:00 2001
4From: Gerion Entrup <[email protected]>
5Date: Thu, 25 Apr 2024 10:14:41 +0200
6Subject: [PATCH] CMakeLists: import jansson with pkgconfig
7
8Upstream jansson offers compiling with autotools and CMake.
9If it is compiled with autotools (the recommended way) it does only
10provide a pkgconfig file and not a cmake file.
11This is also the way most distributions provide jansson, so this commit
12changes the behavior to use pkgconfig, too.
13
14Signed-off-by: Gerion Entrup <[email protected]>
15---
16 CMakeLists.txt | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19diff --git a/CMakeLists.txt b/CMakeLists.txt
20index 1902f0e618119..975a402f8adc2 100644
21--- a/CMakeLists.txt
22+++ b/CMakeLists.txt
23@@ -320,8 +320,11 @@ if (WITH_SYSTEM_PROVIDED_3PARTY)
24 set(GFLAGS_USE_TARGET_NAMESPACE ON)
25 find_package(gflags REQUIRED)
26
27+ find_package(PkgConfig)
28+ pkg_check_modules(jansson REQUIRED IMPORTED_TARGET jansson)
29+ add_library(jansson::jansson ALIAS PkgConfig::jansson)
30+
31 find_package(expat CONFIG REQUIRED)
32- find_package(jansson CONFIG REQUIRED)
33 find_package(pugixml REQUIRED)
34 find_package(utf8cpp REQUIRED)
35 endif()