proj: patch for modern cmake (#43780)

This commit is contained in:
John W. Parent 2024-05-06 10:01:10 -04:00 committed by GitHub
parent a16ee3348b
commit a081b875b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -92,6 +92,11 @@ class Proj(CMakePackage, AutotoolsPackage):
# https://proj.org/install.html#build-requirements # https://proj.org/install.html#build-requirements
with when("build_system=cmake"): with when("build_system=cmake"):
# CMake 3.19 refactored the FindTiff module interface, update older proj's
# to be compatible with this "new" interface
# patch replaces the TIFF_LIBRARY variable (no longer used) with TIFF_LIBRARIES
patch("proj-8.1-cmake-3.29-new-tiff-interface.patch", when="+tiff @:9.1.0 ^cmake@3.19:")
conflicts("cmake@3.19:", when="@:7")
depends_on("cmake@3.9:", when="@6:", type="build") depends_on("cmake@3.9:", when="@6:", type="build")
depends_on("cmake@3.5:", when="@5", type="build") depends_on("cmake@3.5:", when="@5", type="build")
depends_on("cmake@2.6:", when="@:4", type="build") depends_on("cmake@2.6:", when="@:4", type="build")

View file

@ -0,0 +1,13 @@
diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake
index f2de1c10..a5697608 100644
--- a/src/lib_proj.cmake
+++ b/src/lib_proj.cmake
@@ -405,7 +405,7 @@ endif()
if(TIFF_ENABLED)
target_compile_definitions(proj PRIVATE -DTIFF_ENABLED)
target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR})
- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY})
+ target_link_libraries(proj PRIVATE ${TIFF_LIBRARIES})
endif()
if(CURL_ENABLED)