Skip to content

Commit d67b3a0

Browse files
committed
Added pkg-config support. Need to be revised when the dependencies of this lib are moved into separate packages.
1 parent c7fda4e commit d67b3a0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ set(CPACK_DEBIAN_PACKAGE_NAME "lib${PROJECT_NAME}-dev")
9494

9595
set(CPACK_RPM_PACKAGE_NAME "lib${PROJECT_NAME}-devel")
9696

97+
set(PKG_CONFIG_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc")
98+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/packaging/pkgconfig.pc.in" "${PKG_CONFIG_FILE_NAME}" @ONLY)
99+
install(FILES "${PKG_CONFIG_FILE_NAME}"
100+
DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig"
101+
)
102+
97103
list(APPEND CPACK_SOURCE_IGNORE_FILES /.git/ /build/ .gitignore .DS_Store)
98104

99105
include(CPack)

packaging/pkgconfig.pc.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
3+
4+
Name: @PROJECT_NAME@
5+
Description: @PROJECT_DESCRIPTION@
6+
Version: @PROJECT_VERSION@
7+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)