From fcbd4cf9d0aad168b24b5f3ac8bae76b7a616392 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 20 Apr 2022 11:45:01 +0000 Subject: [PATCH] Add generate and install rocksdb.pc file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Installed rocksdb.pc allows easy detection of the presence in system image rocksdb devel resources for other project which want to use rocksdb.pc. Signed-off-by: Tomasz Kłoczko --- CMakeLists.txt | 12 ++++++++++++ rocksdb.pc.in | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 rocksdb.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f8e213fb..eb582e110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1125,6 +1125,11 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) + configure_package_config_file( + ${CMAKE_CURRENT_LIST_DIR}/rocksdb.pc.in rocksdb.pc + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) + install( TARGETS ${ROCKSDB_STATIC_LIB} EXPORT RocksDBTargets @@ -1159,6 +1164,13 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) COMPONENT devel DESTINATION ${package_config_destination} ) + + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/rocksdb.pc + COMPONENT devel + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) endif() option(WITH_ALL_TESTS "Build all test, rather than a small subset" ON) diff --git a/rocksdb.pc.in b/rocksdb.pc.in new file mode 100644 index 000000000..b02815421 --- /dev/null +++ b/rocksdb.pc.in @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/include + +Name: @PROJECT_NAME@ +Description: @CMAKE_PROJECT_DESCRIPTION@ +URL: @CMAKE_PROJECT_HOMEPAGE_URL@ +Version: @PROJECT_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lrocksdb +