summaryrefslogtreecommitdiffstats
path: root/Tests/FindBoost/Test
diff options
context:
space:
mode:
authorSergiu Deitsch <sergiu.deitsch@gmail.com>2018-01-14 10:42:48 (GMT)
committerSergiu Deitsch <sergiu.deitsch@th-nuernberg.de>2018-01-19 16:00:44 (GMT)
commit2557cad5ec5084f86d4bb56c82939a49fc9d3071 (patch)
treed23f50924e34f79dacf9585c5dba3de14429a122 /Tests/FindBoost/Test
parent7b78242d602c5ffa1831478ef624bc41642ca1ff (diff)
downloadCMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.zip
CMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.tar.gz
CMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.tar.bz2
FindBoost: support OPTIONAL_COMPONENTS
Diffstat (limited to 'Tests/FindBoost/Test')
-rw-r--r--Tests/FindBoost/Test/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt
index ce50fc7..663f414 100644
--- a/Tests/FindBoost/Test/CMakeLists.txt
+++ b/Tests/FindBoost/Test/CMakeLists.txt
@@ -2,7 +2,16 @@ cmake_minimum_required(VERSION 3.1)
project(TestFindBoost CXX)
include(CTest)
-find_package(Boost REQUIRED COMPONENTS filesystem thread)
+find_package(Boost REQUIRED COMPONENTS filesystem thread
+ OPTIONAL_COMPONENTS program_options foobar)
+
+if(Boost_FOOBAR_FOUND)
+ message(FATAL_ERROR "Optional inexistent Boost component \"foobar\" found which is unexpected")
+endif(Boost_FOOBAR_FOUND)
+
+if(NOT Boost_PROGRAM_OPTIONS_FOUND)
+ message(FATAL_ERROR "Optional Boost component \"program_options\" not found which is unexpected")
+endif(NOT Boost_PROGRAM_OPTIONS_FOUND)
add_executable(test_boost_tgt main.cxx)
target_link_libraries(test_boost_tgt