blob: ebb5f7c29c91db23731eb9440f6dde594ffac49b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
diff --git a/VTK/CMake/FindFreetype.cmake b/VTK/CMake/FindFreetype.cmake
index b4532735c2..f06d32327e 100644
--- a/VTK/CMake/FindFreetype.cmake
+++ b/VTK/CMake/FindFreetype.cmake
@@ -63,6 +63,30 @@ directory of a Freetype installation.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
+find_package(freetype CONFIG) # foward `QUIET`, version, and components here, but not `REQUIRED`
+if (freetype_FOUND)
+ if (NOT TARGET Freetype::Freetype)
+ # make target chain to target from config mode
+ get_target_property(freetype_library_type freetype TYPE)
+ get_target_property(freetype_location freetype LOCATION)
+ if (freetype_library_type STREQUAL STATIC_LIBRARY)
+ set(freetype_library_type STATIC)
+ endif()
+ get_target_property(freetype_interface_include_directories freetype INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(freetype_interface_link_libraries freetype INTERFACE_LINK_LIBRARIES)
+ add_library(Freetype::Freetype "${freetype_library_type}" IMPORTED)
+ set_target_properties(Freetype::Freetype PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${freetype_interface_include_directories}"
+ INTERFACE_LINK_LIBRARIES "${freetype_interface_link_libraries}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_LOCATION "${freetype_location}")
+ endif ()
+ set(FREETYPE_INCLUDE_DIRS "${freetype_interface_include_directories}")
+ set(FREETYPE_LIBRARIES "${freetype_interface_link_libraries}")
+ set(Freetype_FOUND 1) # might need to also forward the version found
+ return ()
+endif ()
+
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
|