freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 55a97b0cb: CMakeLists.txt: Provide both 'freetype' an


From: Werner Lemberg
Subject: [freetype2] master 55a97b0cb: CMakeLists.txt: Provide both 'freetype' and 'Freetype::Freetype' targets.
Date: Sun, 3 Jul 2022 00:49:49 -0400 (EDT)

branch: master
commit 55a97b0cb133b7a5dc28dfabec77a1b9f742c301
Author: Thomas Sondergaard <thomas@sondergaard.cc>
Commit: Werner Lemberg <wl@gnu.org>

    CMakeLists.txt: Provide both 'freetype' and 'Freetype::Freetype' targets.
    
    FreeType can be located by consuming projects that use
    `find_package(Freetype)` either via the old `MODULE` path (which uses
    `FindFreetype.cmake` supplied by CMake), or via the new `CONFIG` path (which
    uses `freetype-config.cmake` as supplied by this project).  Up to this point
    the CMake module has supplied the target `Freetype::Freetype` and the config
    file provided by this project the target `freetype`.  Now we supply both
    `freetype` and `Freetype::Freetype` so that consuming projects can always
    use the target `Freetype::Freetype` regardless of what path was taken by
    `find_package(Freetype)`.
    
    Fixes #1165.
---
 CMakeLists.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d12897cba..feb4be39a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -498,6 +498,13 @@ if (BUILD_FRAMEWORK)
   )
 endif ()
 
+# 'freetype-interface' is an interface library, to be accessed with
+# `EXPORT_NAME Freetype::Freetype`.  This is the target name provided by
+# CMake's `FindFreetype.cmake`, so we provide it for compatibility.
+add_library(freetype-interface INTERFACE)
+set_target_properties(freetype-interface PROPERTIES
+  EXPORT_NAME Freetype::Freetype
+  INTERFACE_LINK_LIBRARIES freetype)
 
 set(PKGCONFIG_REQUIRES "")
 set(PKGCONFIG_REQUIRES_PRIVATE "")
@@ -615,7 +622,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
     COMPATIBILITY SameMajorVersion)
 
   install(
-    TARGETS freetype
+    TARGETS freetype freetype-interface
       EXPORT freetype-targets
       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]