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)