From ae9890cd36dd2eff99f179f0988ab8bda18e9805 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 26 Oct 2023 12:44:29 -0400 Subject: FindFreeType: consider `IMPLIB`-using platforms See: https://github.com/microsoft/vcpkg/issues/34725 --- Modules/FindFreetype.cmake | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index dcf271d..bebb5f3 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -110,7 +110,24 @@ if (freetype_FOUND) 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 LOCATION) + get_property(_Freetype_location TARGET freetype PROPERTY IMPORTED_IMPLIB) + if (NOT _Freetype_location) + get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELEASE) + 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 TARGET freetype PROPERTY LOCATION) + endif () + unset(_Freetype_location_release) + unset(_Freetype_location_debug) + endif () list(APPEND FREETYPE_LIBRARIES "${_Freetype_location}") unset(_Freetype_location) -- cgit v0.12 From 1cfc708eea11df5fd8c438f517e24940b6cc1917 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 28 Oct 2023 14:19:27 -0400 Subject: FindFreeType: handle config-specific `LOCATION` settings as well `vcpkg` builds release and debug variants on platforms other than Windows (which uses the `IMPLIB` properties). --- Modules/FindFreetype.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index bebb5f3..cd18f2c 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -123,7 +123,19 @@ if (freetype_FOUND) elseif (_Freetype_location_debug) set(_Freetype_location "${_Freetype_location_debug}") else () - get_property(_Freetype_location TARGET freetype PROPERTY LOCATION) + get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELEASE) + 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) -- cgit v0.12 From 2cf2d4f7df60196cbea6834c744a670db511c8d5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 27 Oct 2023 22:24:36 -0400 Subject: FindFreeType: insert Freetype's location to the start This should help static builds satisfy dependencies by listing transitive libraries after freetype's. --- Modules/FindFreetype.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index cd18f2c..b3af7bc 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -140,7 +140,7 @@ if (freetype_FOUND) unset(_Freetype_location_release) unset(_Freetype_location_debug) endif () - list(APPEND FREETYPE_LIBRARIES + list(INSERT FREETYPE_LIBRARIES 0 "${_Freetype_location}") unset(_Freetype_location) set(Freetype_FOUND 1) -- cgit v0.12 From 0117446c97396a9d62ec0f0378c95e49af6d657b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 30 Oct 2023 10:51:10 -0400 Subject: FindFreeType: also set `FREETYPE_FOUND` Fixes: #25371 --- Modules/FindFreetype.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index b3af7bc..583d056 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -144,6 +144,7 @@ if (freetype_FOUND) "${_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}") -- cgit v0.12