Skip to content

Commit

Permalink
add pkg-config support (#340)
Browse files Browse the repository at this point in the history
Adds generation of a pkg-config for installation, improving
dependency discover on Linux systems.

This fixes #339, which can be referenced for more information.
  • Loading branch information
emansom authored Apr 28, 2023
1 parent 2535727 commit b7f43f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,13 @@ install(FILES

include(tools/cmake/cpack.cmake)

include(FindPkgConfig QUIET)
if(PKG_CONFIG_FOUND)
configure_file("${PROJECT_SOURCE_DIR}/tools/pkg-config/stumpless.pc.in" "${PROJECT_BINARY_DIR}/tools/pkg-config/stumpless.pc" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/tools/pkg-config/stumpless.pc"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
endif()


# functionality tests
add_function_test(buffer
Expand Down
10 changes: 10 additions & 0 deletions tools/pkg-config/stumpless.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: @CMAKE_PROJECT_NAME@
Description: C logging library built for high performance and a rich feature set
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lstumpless
Cflags: -I${includedir}

0 comments on commit b7f43f2

Please sign in to comment.