File qmapshack_proj_pkgconfig.patch of Package qmapshack

--- qmapshack-V_1.16.1.orig/CMakeLists.txt	2022-01-02 12:51:16.954614208 +0100
+++ qmapshack-V_1.16.1/CMakeLists.txt	2022-01-02 12:55:05.362469220 +0100
@@ -47,6 +47,7 @@
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 include(DefineInstallationPaths)
+include(FindPkgConfig)
 include(CPackConfig.cmake)
 include(ConfigureChecks.cmake)
 
@@ -151,7 +152,13 @@
 find_package(Qt5Qml                 REQUIRED)
 find_package(Qt5Help                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-Qt5             REQUIRED)
@@ -241,5 +248,3 @@
 # this is used by the uninstall target
 CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
 ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-
-
openSUSE Build Service is sponsored by