From 70fd7c3ff8daf99b663d620a0342f600af5ecf7d Mon Sep 17 00:00:00 2001 From: Adrian Antonana Date: Wed, 26 Apr 2017 14:34:52 +0200 Subject: [PATCH] cmake: export build directory targets and add to CMake's package registry so other projects can use this one without requiring to install the package. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d806cd8..56e62ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,14 @@ write_basic_package_version_file("${PROJECT_BINARY_DIR}/docopt-config-version.cm install(FILES docopt-config.cmake ${PROJECT_BINARY_DIR}/docopt-config-version.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/docopt") install(EXPORT ${export_name} DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/docopt") +# build directory project config +export(EXPORT ${export_name} + FILE docopt-config.cmake +) + +# add packe to CMake registry +export(PACKAGE docopt) + #============================================================================ # CPack #============================================================================