summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindBoost/MissingTarget.cmake
diff options
context:
space:
mode:
authorAlexander Grund <alexander.grund@tu-dresden.de>2019-06-14 07:06:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-18 12:33:36 (GMT)
commit830b332f32ac0782fe3380eb7b0b55fa8f81f456 (patch)
treea2e9aa275e2821f2af36ee2c67cb1c69e3cf7667 /Tests/RunCMake/FindBoost/MissingTarget.cmake
parent0dd6772a89df2e7640187028573f7d981bbd0f67 (diff)
downloadCMake-830b332f32ac0782fe3380eb7b0b55fa8f81f456.zip
CMake-830b332f32ac0782fe3380eb7b0b55fa8f81f456.tar.gz
CMake-830b332f32ac0782fe3380eb7b0b55fa8f81f456.tar.bz2
FindBoost: Add tests for legacy variables
Diffstat (limited to 'Tests/RunCMake/FindBoost/MissingTarget.cmake')
-rw-r--r--Tests/RunCMake/FindBoost/MissingTarget.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindBoost/MissingTarget.cmake b/Tests/RunCMake/FindBoost/MissingTarget.cmake
new file mode 100644
index 0000000..581e006
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/MissingTarget.cmake
@@ -0,0 +1,25 @@
+set(Boost_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakePackage_MissingTarget)
+find_package(Boost 1.70 COMPONENTS date_time)
+
+foreach(var Boost_FOUND Boost_INCLUDE_DIRS Boost_LIBRARY_DIRS Boost_LIBRARIES
+ Boost_DATE_TIME_FOUND Boost_DATE_TIME_LIBRARY
+ Boost_VERSION_MACRO Boost_VERSION_STRING Boost_VERSION Boost_LIB_VERSION
+ Boost_MAJOR_VERSION Boost_MINOR_VERSION Boost_SUBMINOR_VERSION
+)
+ message(STATUS "${var}: ${${var}}")
+endforeach()
+
+foreach(cachevar Boost_INCLUDE_DIR
+ Boost_DATE_TIME_LIBRARY_DEBUG Boost_DATE_TIME_LIBRARY_RELEASE
+)
+ unset(${cachevar})
+ message(STATUS "${cachevar}: ${${cachevar}}")
+endforeach()
+
+foreach(lib Boost::headers
+ Boost::boost Boost::diagnostic_definitions Boost::disable_autolinking Boost::dynamic_linking
+)
+ if(NOT TARGET ${lib})
+ message(FATAL_ERROR "Missing target ${lib}")
+ endif()
+endforeach()