diff options
author | Brad King <brad.king@kitware.com> | 2024-01-25 19:45:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-01-25 19:45:49 (GMT) |
commit | b5725ae619438455edd7ff9ef4e1a89f8a8c0938 (patch) | |
tree | 225e82d57c8d402ed371fd4ea48defb17e62b530 | |
parent | 151601c2e3419bd65bb276e77588c551487b4744 (diff) | |
download | CMake-b5725ae619438455edd7ff9ef4e1a89f8a8c0938.zip CMake-b5725ae619438455edd7ff9ef4e1a89f8a8c0938.tar.gz CMake-b5725ae619438455edd7ff9ef4e1a89f8a8c0938.tar.bz2 |
FindFreetype: Revert use of upstream freetype cmake package
The upstream freetype cmake package uses generator expressions and
imported target to express its dependencies. That's fine on its own.
However, our use of it since commit d83d925045 (FindFreetype: use
`freetype-config.cmake` if available, 2023-09-06, v3.28.0-rc1~130^2)
causes the `FREETYPE_LIBRARIES` result variable to reference those
imported targets and create a package-level dependency for clients that
did not exist previously. Revert that change for now, along with its
follow-up fixes. Further investigation will be needed to solve the
motivating use case another way.
Fixes: #25635
-rw-r--r-- | Modules/FindFreetype.cmake | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 7352769..82885cb 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -65,104 +65,6 @@ directory of a Freetype installation. # I'm going to attempt to cut out the middleman and hope # everything still works. -set(_Freetype_args) -if (Freetype_FIND_VERSION) - list(APPEND _Freetype_args - "${Freetype_FIND_VERSION}") - if (Freetype_FIND_VERSION_EXACT) - list(APPEND _Freetype_args - EXACT) - endif () -endif () -set(_Freetype_component_req) -set(_Freetype_component_opt) -foreach (_Freetype_component IN LISTS Freetype_FIND_COMPONENTS) - if (Freetype_FIND_REQUIRE_${_Freetype_component}) - list(APPEND _Freetype_component_req - "${_Freetype_component}") - else () - list(APPEND _Freetype_component_opt - "${_Freetype_component}") - endif () -endforeach () -unset(_Freetype_component) -if (_Freetype_component_req) - list(APPEND _Freetype_args - COMPONENTS "${_Freetype_component_req}") -endif () -unset(_Freetype_component_req) -if (_Freetype_component_opt) - list(APPEND _Freetype_args - OPTIONAL_COMPONENTS "${_Freetype_component_opt}") -endif () -unset(_Freetype_component_opt) -# Always find with QUIET to avoid noise when it is not found. -find_package(freetype CONFIG QUIET ${_Freetype_args}) -unset(_Freetype_args) -if (freetype_FOUND) - if (NOT TARGET Freetype::Freetype) - add_library(Freetype::Freetype IMPORTED INTERFACE) - set_target_properties(Freetype::Freetype PROPERTIES - INTERFACE_LINK_LIBRARIES freetype) - endif () - get_property(FREETYPE_INCLUDE_DIRS TARGET freetype PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - get_property(FREETYPE_LIBRARIES TARGET freetype PROPERTY INTERFACE_LINK_LIBRARIES) - get_property(_Freetype_location TARGET freetype PROPERTY IMPORTED_IMPLIB) - if (NOT _Freetype_location) - get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELEASE) - if (NOT _Freetype_location_release) - get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELWITHDEBINFO) - endif () - get_property(_Freetype_location_debug TARGET freetype PROPERTY IMPORTED_IMPLIB_DEBUG) - if (_Freetype_location_release AND _Freetype_location_debug) - set(_Freetype_location - optimized "${_Freetype_location_release}" - debug "${_Freetype_location_debug}") - elseif (_Freetype_location_release) - set(_Freetype_location "${_Freetype_location_release}") - elseif (_Freetype_location_debug) - set(_Freetype_location "${_Freetype_location_debug}") - else () - get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELEASE) - if (NOT _Freetype_location_release) - get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELWITHDEBINFO) - endif () - get_property(_Freetype_location_debug TARGET freetype PROPERTY LOCATION_DEBUG) - if (_Freetype_location_release AND _Freetype_location_debug) - set(_Freetype_location - optimized "${_Freetype_location_release}" - debug "${_Freetype_location_debug}") - elseif (_Freetype_location_release) - set(_Freetype_location "${_Freetype_location_release}") - elseif (_Freetype_location_debug) - set(_Freetype_location "${_Freetype_location_debug}") - else () - get_property(_Freetype_location TARGET freetype PROPERTY LOCATION) - endif () - endif () - unset(_Freetype_location_release) - unset(_Freetype_location_debug) - endif () - list(INSERT FREETYPE_LIBRARIES 0 - "${_Freetype_location}") - unset(_Freetype_location) - set(Freetype_FOUND 1) - set(FREETYPE_FOUND 1) - set(FREETYPE_VERSION_STRING "${freetype_VERSION}") - foreach (_Freetype_component IN LISTS Freetype_FIND_COMPONENTS) - set(Freetype_${_Freetype_component}_FOUND "${freetype_${_Freetype_component}_FOUND}") - endforeach () - unset(_Freetype_component) - - include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) - find_package_handle_standard_args(Freetype - HANDLE_COMPONENTS - VERSION_VAR FREETYPE_VERSION_STRING - ) - - return () -endif () - set(FREETYPE_FIND_ARGS HINTS ENV FREETYPE_DIR |