diff options
author | Brad King <brad.king@kitware.com> | 2017-10-02 11:57:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-10-02 11:58:08 (GMT) |
commit | 9288c291cb56f75ad0ed8a86b0882d1998c8b79d (patch) | |
tree | 901a19e8ecd86e6212a4ada0f5addf0b0397ba79 | |
parent | 90bd92ae8876cff7c2d372e752e2297411ce2d1b (diff) | |
parent | c044b9ae8421cae4ee91399dabee31aa75f80b1c (diff) | |
download | CMake-9288c291cb56f75ad0ed8a86b0882d1998c8b79d.zip CMake-9288c291cb56f75ad0ed8a86b0882d1998c8b79d.tar.gz CMake-9288c291cb56f75ad0ed8a86b0882d1998c8b79d.tar.bz2 |
Merge topic 'FindBoost-cmake-package'
c044b9ae FindBoost: Improve messages when a Boost CMake package is found
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1330
-rw-r--r-- | Modules/FindBoost.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/CMakePackage-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/CMakePackage.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/FindBoost/RunCMakeTest.cmake | 3 |
8 files changed, 21 insertions, 3 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 6d1514d..88d14ab 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -245,10 +245,9 @@ if (NOT Boost_NO_BOOST_CMAKE) # If we found boost-cmake, then we're done. Print out what we found. # Otherwise let the rest of the module try to find it. if (Boost_FOUND) - message("Boost ${Boost_FIND_VERSION} found.") + message(STATUS "Boost ${Boost_FIND_VERSION} found.") if (Boost_FIND_COMPONENTS) - message("Found Boost components:") - message(" ${Boost_FIND_COMPONENTS}") + message(STATUS "Found Boost components:\n ${Boost_FIND_COMPONENTS}") endif() # Restore project's policies cmake_policy(POP) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 5622f8e..57cc144 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -141,6 +141,7 @@ add_RunCMake_test(DisallowedCommands) add_RunCMake_test(ExternalData) add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) +add_RunCMake_test(FindBoost) if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) endif() diff --git a/Tests/RunCMake/FindBoost/CMakeLists.txt b/Tests/RunCMake/FindBoost/CMakeLists.txt new file mode 100644 index 0000000..d3137f6 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.9) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt new file mode 100644 index 0000000..664e4a5 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt @@ -0,0 +1,3 @@ +-- Boost 1\.12345 found\. +-- Found Boost components: + date_time diff --git a/Tests/RunCMake/FindBoost/CMakePackage.cmake b/Tests/RunCMake/FindBoost/CMakePackage.cmake new file mode 100644 index 0000000..06aeccb --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackage.cmake @@ -0,0 +1,2 @@ +set(Boost_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakePackage) +find_package(Boost 1.12345 COMPONENTS date_time) diff --git a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfig.cmake diff --git a/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake new file mode 100644 index 0000000..8176ced --- /dev/null +++ b/Tests/RunCMake/FindBoost/CMakePackage/BoostConfigVersion.cmake @@ -0,0 +1,7 @@ +set(PACKAGE_VERSION 1.12345) +if(PACKAGE_FIND_VERSION_MAJOR EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if(PACKAGE_FIND_VERSION_MINOR EQUAL 12345) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake new file mode 100644 index 0000000..a153ae1 --- /dev/null +++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(CMakePackage) |