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..24119b1 --- /dev/null +++ b/nbytes.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: nbytes +Description: Library of byte handling functions extracted from Node.js core +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lnbytes +Cflags: -I${includedir}