From a081b875b436022515ef2a284313ca887bb28bc4 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Mon, 6 May 2024 10:01:10 -0400 Subject: [PATCH] proj: patch for modern cmake (#43780) --- var/spack/repos/builtin/packages/proj/package.py | 5 +++++ .../proj-8.1-cmake-3.29-new-tiff-interface.patch | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 var/spack/repos/builtin/packages/proj/proj-8.1-cmake-3.29-new-tiff-interface.patch diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py index ef18d834dc..633ca182f8 100644 --- a/var/spack/repos/builtin/packages/proj/package.py +++ b/var/spack/repos/builtin/packages/proj/package.py @@ -92,6 +92,11 @@ class Proj(CMakePackage, AutotoolsPackage): # https://proj.org/install.html#build-requirements 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.5:", when="@5", type="build") depends_on("cmake@2.6:", when="@:4", type="build") diff --git a/var/spack/repos/builtin/packages/proj/proj-8.1-cmake-3.29-new-tiff-interface.patch b/var/spack/repos/builtin/packages/proj/proj-8.1-cmake-3.29-new-tiff-interface.patch new file mode 100644 index 0000000000..d278029aed --- /dev/null +++ b/var/spack/repos/builtin/packages/proj/proj-8.1-cmake-3.29-new-tiff-interface.patch @@ -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)