summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindBoost/MissingTarget.cmake
blob: 581e0065febc11ee3a3940c464b8f6eb6f1091bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()