From e790afa8c9aa60b328b5be5b47497cb1ffa0d5eb Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 5 Jan 2026 00:25:47 +0100 Subject: [PATCH 1/2] chore: add pkgconfig support --- CMakeLists.txt | 15 ++++++++++++++- nbytes.pc.in | 10 ++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 nbytes.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index f2efa3c..2dade34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.28) -project(nbytes) +project(nbytes VERSION 0.1.2) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -40,3 +40,16 @@ install( ARCHIVE COMPONENT nbytes_development INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) + +# Configure and install pkg-config file +configure_file( + "${PROJECT_SOURCE_DIR}/nbytes.pc.in" + "${PROJECT_BINARY_DIR}/nbytes.pc" + @ONLY +) + +install( + FILES "${PROJECT_BINARY_DIR}/nbytes.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + COMPONENT nbytes_development +) diff --git a/nbytes.pc.in b/nbytes.pc.in new file mode 100644 index 0000000..de238f3 --- /dev/null +++ b/nbytes.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: nbytes +Description: Library of byte handling functions extracted from Node.js core +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lnbytes +Cflags: -I${includedir} From 540f5f932e40939a853ae969506460c0ce54fbb0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 5 Jan 2026 00:32:27 +0100 Subject: [PATCH 2/2] fixup! chore: add pkgconfig support --- nbytes.pc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbytes.pc.in b/nbytes.pc.in index de238f3..24119b1 100644 --- a/nbytes.pc.in +++ b/nbytes.pc.in @@ -1,7 +1,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: nbytes Description: Library of byte handling functions extracted from Node.js core