diff --git a/CMakeLists.txt b/CMakeLists.txt index c9946ce63..e51023c1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/tools/pkg-config/stumpless.pc.in b/tools/pkg-config/stumpless.pc.in new file mode 100644 index 000000000..b8c573bcb --- /dev/null +++ b/tools/pkg-config/stumpless.pc.in @@ -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}