From 6455fb53da57b3cddb16e830d3ed0b58c239ae87 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 4 Sep 2026 18:47:26 +0200 Subject: [PATCH] build: add Libs/Cflags to libzpc.pc and fix libdir substitution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libzpc.pc shipped without Libs: and Cflags:, so `pkg-config --libs libzpc` returned nothing and consumers linked without -lzpc. libdir and includedir were declared and then never referenced by any field. configure_file() also ran before include(GNUInstallDirs), so @CMAKE_INSTALL_LIBDIR@/@CMAKE_INSTALL_INCLUDEDIR@ expanded empty unless the caller set them on the command line — move the include first, otherwise ${libdir} in the new Libs: line is wrong for a plain build. No API or ABI change. Link: https://bugzilla.suse.com/show_bug.cgi?id=1279335 Signed-off-by: Martin Pluskal --- CMakeLists.txt | 2 +- libzpc.pc.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5223abb5..d2f58c61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,8 +122,8 @@ target_compile_definitions( ZPC_VERSION_MINOR=${ZPC_VERSION_MINOR} ZPC_VERSION_PATCH=${ZPC_VERSION_PATCH} ) -configure_file(libzpc.pc.in libzpc.pc @ONLY) include(GNUInstallDirs) +configure_file(libzpc.pc.in libzpc.pc @ONLY) install( TARGETS zpc diff --git a/libzpc.pc.in b/libzpc.pc.in index 502ca472..e73a429e 100644 --- a/libzpc.pc.in +++ b/libzpc.pc.in @@ -6,3 +6,5 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: @PROJECT_NAME@ Description: @PROJECT_DESCRIPTION@ Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lzpc +Cflags: -I${includedir}