ref: 385345037e04f9ee6ffc8b14318f1a079520c41d
parent: 8a33164dad3e081dea219de6f19d8ba697fba1c2
author: Werner Lemberg <wl@gnu.org>
date: Thu Mar 31 16:52:43 EDT 2022
CMakeList.txt: Update code to handle recent changes for `freetype.pc`. Fixes #1144.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -498,7 +498,9 @@
endif ()
+set(PKGCONFIG_REQUIRES "")
set(PKGCONFIG_REQUIRES_PRIVATE "")
+set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
set(PKGCONFIG_LIBS_PRIVATE "")
if (ZLIB_FOUND)
@@ -569,10 +571,26 @@
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- string(REPLACE "%REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
- FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- string(REPLACE "%LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
- FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+
+ if (BUILD_SHARED_LIBS)
+ string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ else ()
+ string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ endif ()
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
if (EXISTS "${FREETYPE2_PC_IN_NAME}")