From 7123bbec047a05d9f33413177ce496092d717ce3 Mon Sep 17 00:00:00 2001 From: Will Reed Date: Sun, 19 Jul 2026 12:33:09 -0500 Subject: [PATCH 1/2] chore: add pkgconfig template files for cmake --- scripts/openzl-cpp.pc.in | 14 ++++++++++++++ scripts/openzl.pc.in | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 scripts/openzl-cpp.pc.in create mode 100644 scripts/openzl.pc.in diff --git a/scripts/openzl-cpp.pc.in b/scripts/openzl-cpp.pc.in new file mode 100644 index 000000000..6346165a8 --- /dev/null +++ b/scripts/openzl-cpp.pc.in @@ -0,0 +1,14 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +name: @PACKAGE_NAME@-cpp +description: @PACKAGE_DESCRIPTION@ +version: @PACKAGE_VERSION@ +license: BSD-3-Clause +url: https://openzl.org +source: http://github.com/facebook/openzl/archive/v@PACKAGE_VERSION@/openzl-@PACKAGE_VERSION@.tar.gz +requires: libzstd openzl +libs: -L${libdir} -lopenzl_cpp +cflags: -I${includedir} diff --git a/scripts/openzl.pc.in b/scripts/openzl.pc.in new file mode 100644 index 000000000..6b9ef6573 --- /dev/null +++ b/scripts/openzl.pc.in @@ -0,0 +1,14 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +name: @PACKAGE_NAME@ +description: @PACKAGE_DESCRIPTION@ +version: @PACKAGE_VERSION@ +license: BSD-3-Clause +url: https://openzl.org +source: http://github.com/facebook/openzl/archive/v@PACKAGE_VERSION@/openzl-@PACKAGE_VERSION@.tar.gz +requires: libzstd +libs: -L${libdir} -lopenzl +cflags: -I${includedir} From e129d992f59ad61e4d4c252bc7b4cb6306296abe Mon Sep 17 00:00:00 2001 From: Will Reed Date: Sun, 19 Jul 2026 12:33:49 -0500 Subject: [PATCH 2/2] chore: update CMakeLists to configure/install pkgconfig files --- CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6c77432c..bb4235072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.20.2 FATAL_ERROR) cmake_policy(SET CMP0077 NEW) set(PACKAGE_NAME "openzl") +set(PACKAGE_DESCRIPTION "A novel data compression framework") project(${PACKAGE_NAME} CXX C ASM) # ---- Build Options ---- @@ -310,7 +311,23 @@ if (OPENZL_INSTALL) COMPONENT dev ) - # TODO: Generate a pkg-config file + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/openzl.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/openzl.pc" + @ONLY + ) + + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/openzl-cpp.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/openzl-cpp.pc" + @ONLY + ) + + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/openzl.pc" "${CMAKE_CURRENT_BINARY_DIR}/openzl-cpp.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) + endif() # ---- Trailing User Messages ----