File qmapshack_proj_pkgconfig.patch of Package qmapshack

--- qmapshack-V_1.16.0.orig/CMakeLists.txt	2021-05-24 11:18:08.000000000 +0200
+++ qmapshack-V_1.16.0/CMakeLists.txt	2021-08-16 11:32:58.954978484 +0200
@@ -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