diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-12-13 16:34:08 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-12-13 18:12:45 (GMT) |
commit | 581acbce523dada7005bf0bef43eff346610e936 (patch) | |
tree | cde7083c0805bbee6505cca2ccfa9ab719b58219 | |
parent | e8e7d9f775c3811ae58de75056c68f300868081e (diff) | |
download | CMake-581acbce523dada7005bf0bef43eff346610e936.zip CMake-581acbce523dada7005bf0bef43eff346610e936.tar.gz CMake-581acbce523dada7005bf0bef43eff346610e936.tar.bz2 |
FindTIFF: consider `IMPLIB`-using platforms
Support multi-config-providing and `IMPLIB`-using deployments with the
`tiff-config` trampoline code. Follow the pattern used in `FindFreetype`
by commit ae9890cd36 (FindFreeType: consider `IMPLIB`-using platforms,
2023-10-26, v3.28.0-rc4~10^2~3).
See: #25485
-rw-r--r-- | Modules/FindTIFF.cmake | 79 |
1 files changed, 75 insertions, 4 deletions
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index 45b3164..2a99314 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -107,15 +107,86 @@ if (tiff_FOUND) endif () get_property(TIFF_INCLUDE_DIRS TARGET TIFF::tiff PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(TIFF_LIBRARIES TARGET TIFF::tiff PROPERTY INTERFACE_LINK_LIBRARIES) - get_property(_TIFF_location TARGET TIFF::tiff PROPERTY LOCATION) - list(APPEND TIFF_LIBRARIES + get_property(_TIFF_location TARGET TIFF::tiff PROPERTY IMPORTED_IMPLIB) + if (NOT _TIFF_location) + get_property(_TIFF_location_release TARGET TIFF::tiff PROPERTY IMPORTED_IMPLIB_RELEASE) + if (NOT _TIFF_location_release) + get_property(_TIFF_location_release TARGET TIFF::tiff PROPERTY IMPORTED_IMPLIB_RELWITHDEBINFO) + endif () + get_property(_TIFF_location_debug TARGET TIFF::tiff PROPERTY IMPORTED_IMPLIB_DEBUG) + if (_TIFF_location_release AND _TIFF_location_debug) + set(_TIFF_location + optimized "${_TIFF_location_release}" + debug "${_TIFF_location_debug}") + elseif (_TIFF_location_release) + set(_TIFF_location "${_TIFF_location_release}") + elseif (_TIFF_location_debug) + set(_TIFF_location "${_TIFF_location_debug}") + else () + get_property(_TIFF_location_release TARGET TIFF::tiff PROPERTY LOCATION_RELEASE) + if (NOT _TIFF_location_release) + get_property(_TIFF_location_release TARGET TIFF::tiff PROPERTY LOCATION_RELWITHDEBINFO) + endif () + get_property(_TIFF_location_debug TARGET TIFF::tiff PROPERTY LOCATION_DEBUG) + if (_TIFF_location_release AND _TIFF_location_debug) + set(_TIFF_location + optimized "${_TIFF_location_release}" + debug "${_TIFF_location_debug}") + elseif (_TIFF_location_release) + set(_TIFF_location "${_TIFF_location_release}") + elseif (_TIFF_location_debug) + set(_TIFF_location "${_TIFF_location_debug}") + else () + get_property(_TIFF_location TARGET TIFF::tiff PROPERTY LOCATION) + endif () + endif () + unset(_TIFF_location_release) + unset(_TIFF_location_debug) + endif () + list(INSERT TIFF_LIBRARIES 0 "${_TIFF_location}") unset(_TIFF_location) set(TIFF_FOUND 1) if("CXX" IN_LIST TIFF_FIND_COMPONENTS) if (TARGET TIFF::CXX) - get_property(_TIFF_CXX_location TARGET TIFF::CXX PROPERTY LOCATION) - list(APPEND TIFF_LIBRARIES ${_TIFF_CXX_location}) + get_property(_TIFF_CXX_location TARGET TIFF::CXX PROPERTY IMPORTED_IMPLIB) + if (NOT _TIFF_CXX_location) + get_property(_TIFF_CXX_location_release TARGET TIFF::CXX PROPERTY IMPORTED_IMPLIB_RELEASE) + if (NOT _TIFF_CXX_location_release) + get_property(_TIFF_CXX_location_release TARGET TIFF::CXX PROPERTY IMPORTED_IMPLIB_RELWITHDEBINFO) + endif () + get_property(_TIFF_CXX_location_debug TARGET TIFF::CXX PROPERTY IMPORTED_IMPLIB_DEBUG) + if (_TIFF_CXX_location_release AND _TIFF_CXX_location_debug) + set(_TIFF_CXX_location + optimized "${_TIFF_CXX_location_release}" + debug "${_TIFF_CXX_location_debug}") + elseif (_TIFF_CXX_location_release) + set(_TIFF_CXX_location "${_TIFF_CXX_location_release}") + elseif (_TIFF_CXX_location_debug) + set(_TIFF_CXX_location "${_TIFF_CXX_location_debug}") + else () + get_property(_TIFF_CXX_location_release TARGET TIFF::CXX PROPERTY LOCATION_RELEASE) + if (NOT _TIFF_CXX_location_release) + get_property(_TIFF_CXX_location_release TARGET TIFF::CXX PROPERTY LOCATION_RELWITHDEBINFO) + endif () + get_property(_TIFF_CXX_location_debug TARGET TIFF::CXX PROPERTY LOCATION_DEBUG) + if (_TIFF_CXX_location_release AND _TIFF_CXX_location_debug) + set(_TIFF_CXX_location + optimized "${_TIFF_CXX_location_release}" + debug "${_TIFF_CXX_location_debug}") + elseif (_TIFF_CXX_location_release) + set(_TIFF_CXX_location "${_TIFF_CXX_location_release}") + elseif (_TIFF_CXX_location_debug) + set(_TIFF_CXX_location "${_TIFF_CXX_location_debug}") + else () + get_property(_TIFF_CXX_location TARGET TIFF::CXX PROPERTY LOCATION) + endif () + endif () + unset(_TIFF_CXX_location_release) + unset(_TIFF_CXX_location_debug) + endif () + list(INSERT TIFF_LIBRARIES 0 + "${_TIFF_CXX_location}") unset(_TIFF_CXX_location) set(TIFF_CXX_FOUND 1) else () |