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 +