FindFreetype: does not support in-tree builds of Freetype
This patch, which is most likely not in acceptable form for a merge request, allows my own project to build with freetype in-tree.
An interested party may choose to take this and run with it.
--- /usr/share/cmake/Modules/FindFreetype.cmake2022-01-25 07:45:06.000000000 -0600
+++ FindFreetype.cmake 2022-02-25 13:34:39.990412922 -0600
@@ -65,6 +65,27 @@
# I'm going to attempt to cut out the middleman and hope
# everything still works.
+if(TARGET freetype)
+ if(NOT TARGET Freetype::Freetype)
+ add_library(Freetype::Freetype ALIAS freetype)
+ endif()
+
+ set(FREETYPE_LIBRARIES Freetype::Freetype)
+ get_target_property(FREETYPE_INCLUDE_DIRS Freetype::Freetype INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(FREETYPE_VERSION_STRING Freetype::Freetype VERSION)
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(
+ Freetype
+ REQUIRED_VARS
+ FREETYPE_LIBRARIES
+ FREETYPE_INCLUDE_DIRS
+ VERSION_VAR
+ FREETYPE_VERSION_STRING
+ )
+ return()
+endif()
+
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
Edited by Brad King