Fix FTBFS with libproxy 0.5.
authorBas Couwenberg <sebastic@debian.org>
Wed, 13 Mar 2024 14:22:13 +0000 (15:22 +0100)
committerBas Couwenberg <sebastic@debian.org>
Wed, 13 Mar 2024 14:22:13 +0000 (15:22 +0100)
Bug-Debian: https://bugs.debian.org/1066442
Forwarded: https://github.com/openstreetmap/merkaartor/pull/293

proxy.h includes glib-object.h which needs to be found too.
Use pkg-config to get these paths.

Gbp-Pq: Name libproxy.patch

CMakeLists.txt

index 37bb47ada66e28332ba82c90775c0b050a20182d..07913186bb21f0fc1cab71fa574252b050af3367 100644 (file)
@@ -486,6 +486,7 @@ set(PKGCONFIG_REQUIRED_LIBS gdal proj)
 option(ZBAR        "Enable ZBar usage in MWalkingPapersBackground and Geoimage."      OFF)
 option(GEOIMAGE    "Enable Geoimage Dock (requires exiv2 library)."                   ON )
 option(GPSD        "Enable GPS Dock (requires gpsd library)."                         OFF)
+option(LIBPROXY    "Enable libproxy usage."                                           OFF)
 option(WEBENGINE   "Enable the use of QtWeb engine (not supported on all platforms)"  OFF)
 option(EXTRA_TESTS "Enable extra tests that cannot be run automatically on CI build." ON )
 
@@ -493,6 +494,7 @@ message(STATUS "Build options (use -DOPT=ON/OFF to enable/disable):")
 message(STATUS " * ZBAR        ${ZBAR}")
 message(STATUS " * GEOIMAGE    ${GEOIMAGE}")
 message(STATUS " * GPSD        ${GPSD}")
+message(STATUS " * LIBPROXY    ${LIBPROXY}")
 message(STATUS " * WEBENGINE   ${WEBENGINE}")
 message(STATUS " * EXTRA_TESTS ${EXTRA_TESTS}")
 message(STATUS "")
@@ -512,6 +514,11 @@ if (GPSD)
     add_definitions(-DUSE_GPS=1)
 endif()
 
+if (LIBPROXY)
+    list(APPEND PKGCONFIG_REQUIRED_LIBS libproxy-1.0)
+    add_definitions(-DUSE_LIBPROXY=1)
+endif()
+
 if (WEBENGINE)
     add_definitions(-DUSEWEBENGINE=1) # Actual macro is USE_WEBKIT
     # add_definitions(-DTHREADED_BROWSERIMAGEMANAGER=1) # TODO: Check if that even does something/works