aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wheeler <scott@directededge.com>2019-09-10 12:41:11 +0200
committerScott Wheeler <scott@directededge.com>2019-09-10 12:41:11 +0200
commitef1312d62239f399c40233d76ef3328b8dadf984 (patch)
tree192869d897726eb38372b8ebce2d35a3df8b2936
parent86c042847571db0bdfa8dbb6093a30d4ff03be11 (diff)
Add -lz to taglib.pc and taglib-config when built with zlib
Closes #872
-rw-r--r--CMakeLists.txt4
-rw-r--r--taglib-config.cmake2
-rw-r--r--taglib.pc.cmake2
3 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a0302c4..3d2470c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,10 @@ math(EXPR TAGLIB_SOVERSION_PATCH "${TAGLIB_SOVERSION_REVISION}")
include(ConfigureChecks.cmake)
+if(${ZLIB_FOUND})
+ set(ZLIB_LIBRARIES_FLAGS -lz)
+endif()
+
if(NOT WIN32)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/taglib-config" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/taglib-config" DESTINATION "${BIN_INSTALL_DIR}")
diff --git a/taglib-config.cmake b/taglib-config.cmake
index c91e28db..2a5c19f9 100644
--- a/taglib-config.cmake
+++ b/taglib-config.cmake
@@ -29,7 +29,7 @@ while test $# -gt 0
do
case $1 in
--libs)
- flags="$flags -L$libdir -ltag"
+ flags="$flags -L$libdir -ltag @ZLIB_LIBRARIES_FLAGS@"
;;
--cflags)
flags="$flags -I$includedir/taglib"
diff --git a/taglib.pc.cmake b/taglib.pc.cmake
index ba9d655b..9f56a3e6 100644
--- a/taglib.pc.cmake
+++ b/taglib.pc.cmake
@@ -7,5 +7,5 @@ Name: TagLib
Description: Audio meta-data library
Requires:
Version: @TAGLIB_LIB_VERSION_STRING@
-Libs: -L${libdir} -ltag
+Libs: -L${libdir} -ltag @ZLIB_LIBRARIES_FLAGS@
Cflags: -I${includedir}/taglib