File qmapshack_proj_pkgconfig.patch of Package qmapshack

---
 CMakeLists.txt |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- qmapshack-V_1.18.0.orig/CMakeLists.txt
+++ qmapshack-V_1.18.0/CMakeLists.txt
@@ -46,6 +46,7 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINAR
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 include(DefineInstallationPaths)
+include(FindPkgConfig)
 include(CPackConfig.cmake)
 include(ConfigureChecks.cmake)
 
@@ -192,7 +193,13 @@ find_package(Qt6WebEngineWidgets    REQU
 find_package(Qt6Qml                 REQUIRED)
 find_package(Qt6Help                REQUIRED)
 find_package(GDAL                   REQUIRED)
-find_package(PROJ                   REQUIRED)
+# if proj was build with autotools, it doesn't install the cmake files
+# but a pkg-config (.pc) file - so we have to check both (first cmake,
+# if that wasn't found pkg-config and fail hard if that doesn't work either)
+find_package(PROJ)
+if (NOT PROJ_FOUND)
+  pkg_search_module(PROJ REQUIRED proj)
+endif()
 find_package(JPEG                   REQUIRED)
 find_package(ROUTINO                REQUIRED)
 find_package(QuaZip-Qt6             REQUIRED)
openSUSE Build Service is sponsored by