* CMakeLists.txt: Improve 'bz2' support. Not all distributions such as FreeBSD provide a `.pc` file for '(lib)bz2' so follow autotools and add it to `Libs.private` instead.
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 36 37 38 39 40 41 42 43 44 45
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7f707c..81648a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -443,6 +443,7 @@ endif ()
set(PKG_CONFIG_REQUIRED_PRIVATE "")
+set(PKG_CONFIG_LIBS_PRIVATE "")
if (ZLIB_FOUND)
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
@@ -452,7 +453,7 @@ endif ()
if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
- list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
+ list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
endif ()
if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
@@ -511,7 +512,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
+ string(REPLACE "%LIBS_PRIVATE%" "${PKG_CONFIG_LIBS_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
diff --git a/ChangeLog b/ChangeLog
index 1c443b4..ef0fe4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-02-15 Daniel E <daniel.engberg.lists@pyret.net>
+
+ * CMakeLists.txt: Improve 'bz2' support.
+
+ Not all distributions such as FreeBSD provide a `.pc` file for
+ '(lib)bz2' so follow autotools and add it to `Libs.private` instead.
+
2021-02-13 Werner Lemberg <wl@gnu.org>
* src/tools/update-copyright-year: Fix single-year entry handling.