Skip to content

Commit

Permalink
add pkg-config file (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
emansom committed Apr 28, 2023
1 parent ce3c36d commit 431467b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2.3)
cmake_minimum_required(VERSION 3.12)

if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
Expand Down 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: @CMAKE_PROJECT_VERSION@
Libs: -L${libdir} -lstumpless
Cflags: -I${includedir}

0 comments on commit 431467b

Please sign in to comment.