diff options
author | Victor Costan <costan@google.com> | 2019-11-07 21:39:02 -0800 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2019-11-07 22:44:08 -0800 |
commit | 41c8d839149134a3a6c8908f185437f536a47211 (patch) | |
tree | 384da7fc8985652efd79b160bfc87be2a6da0a98 | |
parent | 0c40829872a9f00f38e11dc370ff8adb3e19f25b (diff) | |
download | leveldb-41c8d839149134a3a6c8908f185437f536a47211.tar.gz |
Align CMake configuration with related projects.
PiperOrigin-RevId: 279238007
-rw-r--r-- | CMakeLists.txt | 19 | ||||
-rw-r--r-- | cmake/leveldbConfig.cmake | 1 | ||||
-rw-r--r-- | cmake/leveldbConfig.cmake.in | 9 |
3 files changed, 21 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cb4625..2ad1c6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,23 +443,28 @@ if(LEVELDB_INSTALL) "${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h" "${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h" "${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/leveldb + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/leveldb" ) include(CMakePackageConfigHelpers) + configure_package_config_file( + "cmake/${PROJECT_NAME}Config.cmake.in" + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) write_basic_package_version_file( - "${PROJECT_BINARY_DIR}/leveldbConfigVersion.cmake" - COMPATIBILITY SameMajorVersion + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + COMPATIBILITY SameMajorVersion ) install( EXPORT leveldbTargets NAMESPACE leveldb:: - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/leveldb" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) install( FILES - "cmake/leveldbConfig.cmake" - "${PROJECT_BINARY_DIR}/leveldbConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/leveldb" + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) endif(LEVELDB_INSTALL) diff --git a/cmake/leveldbConfig.cmake b/cmake/leveldbConfig.cmake deleted file mode 100644 index eea6e5c..0000000 --- a/cmake/leveldbConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/leveldbTargets.cmake") diff --git a/cmake/leveldbConfig.cmake.in b/cmake/leveldbConfig.cmake.in new file mode 100644 index 0000000..2572728 --- /dev/null +++ b/cmake/leveldbConfig.cmake.in @@ -0,0 +1,9 @@ +# Copyright 2019 The LevelDB Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. See the AUTHORS file for names of contributors. + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/leveldbTargets.cmake") + +check_required_components(leveldb)
\ No newline at end of file |