Skip to content

Commit 00f48a0

Browse files
authored
chore: add pkgconfig support (#10)
1 parent 556b0bc commit 00f48a0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.28)
2-
project(nbytes)
2+
project(nbytes VERSION 0.1.2)
33

44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED True)
@@ -40,3 +40,16 @@ install(
4040
ARCHIVE COMPONENT nbytes_development
4141
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
4242
)
43+
44+
# Configure and install pkg-config file
45+
configure_file(
46+
"${PROJECT_SOURCE_DIR}/nbytes.pc.in"
47+
"${PROJECT_BINARY_DIR}/nbytes.pc"
48+
@ONLY
49+
)
50+
51+
install(
52+
FILES "${PROJECT_BINARY_DIR}/nbytes.pc"
53+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
54+
COMPONENT nbytes_development
55+
)

nbytes.pc.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
exec_prefix=${prefix}
3+
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
4+
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
5+
6+
Name: nbytes
7+
Description: Library of byte handling functions extracted from Node.js core
8+
Version: @PROJECT_VERSION@
9+
Libs: -L${libdir} -lnbytes
10+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)