summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindBoost.cmake88
1 files changed, 84 insertions, 4 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 3d573b8..777003b 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -310,7 +310,7 @@ macro(_Boost_ADJUST_LIB_VARS basename)
set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
endif()
- if(Boost_${basename}_LIBRARY)
+ if(Boost_${basename}_LIBRARY AND Boost_${basename}_HEADER)
set(Boost_${basename}_FOUND ON)
endif()
@@ -522,7 +522,9 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
#
# The output may be added in a new block below. If it's the same as
# the previous release, simply update the version range of the block
- # for the previous release.
+ # for the previous release. Also check if any new components have
+ # been added, and add any new components to
+ # _Boost_COMPONENT_HEADERS.
#
# This information was originally generated by running
# BoostScanDeps.cmake against every boost release to date supported
@@ -740,6 +742,67 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
endfunction()
#
+# Get component headers. This is the primary header (or headers) for
+# a given component, and is used to check that the headers are present
+# as well as the library itself as an extra sanity check of the build
+# environment.
+#
+# component - the component to check
+# _hdrs
+#
+function(_Boost_COMPONENT_HEADERS component _hdrs)
+ # Note: new boost components will require adding here. The header
+ # must be present in all versions of Boost providing a library.
+ set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
+ set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
+ set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
+ set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
+ set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
+ set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
+ set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
+ set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
+ set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
+ set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
+ set(_Boost_IOSTREAMS_HEADERS "boost/iostreams/stream.hpp")
+ set(_Boost_LOCALE_HEADERS "boost/locale.hpp")
+ set(_Boost_LOG_HEADERS "boost/log/core.hpp")
+ set(_Boost_LOG_SETUP_HEADERS "boost/log/detail/setup_config.hpp")
+ set(_Boost_MATH_HEADERS "boost/math_fwd.hpp")
+ set(_Boost_MATH_C99_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MATH_C99F_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MATH_C99L_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MATH_TR1_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MATH_TR1F_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
+ set(_Boost_MPI_HEADERS "boost/mpi.hpp")
+ set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
+ set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
+ set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
+ set(_Boost_PYTHON_HEADERS "boost/python.hpp")
+ set(_Boost_RANDOM_HEADERS "boost/random.hpp")
+ set(_Boost_REGEX_HEADERS "boost/regex.hpp")
+ set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
+ set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
+ set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
+ set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
+ set(_Boost_THREAD_HEADERS "boost/thread.hpp")
+ set(_Boost_TIMER_HEADERS "boost/timer.hpp")
+ set(_Boost_TYPE_ERASURE_HEADERS "boost/type_erasure/config.hpp")
+ set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
+ set(_Boost_WAVE_HEADERS "boost/wave.hpp")
+ set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
+
+ string(TOUPPER ${component} uppercomponent)
+ set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
+
+ string(REGEX REPLACE ";" " " _boost_HDRS_STRING "${_Boost_${uppercomponent}_HEADERS}")
+ if (NOT _boost_HDRS_STRING)
+ set(_boost_HDRS_STRING "(none)")
+ endif()
+ # message(STATUS "Headers for Boost::${component}: ${_boost_HDRS_STRING}")
+endfunction()
+
+#
# Determine if any missing dependencies require adding to the component list.
#
# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
@@ -826,8 +889,9 @@ else()
# versions, find those that are acceptable to the user request.
#
# Note: When adding a new Boost release, also update the dependency
- # information in _Boost_COMPONENT_DEPENDENCIES. See the
- # instructions at the top of _Boost_COMPONENT_DEPENDENCIES.
+ # information in _Boost_COMPONENT_DEPENDENCIES and
+ # _Boost_COMPONENT_HEADERS. See the instructions at the top of
+ # _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
@@ -1366,6 +1430,22 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
endif()
#
+ # Find headers
+ #
+ _Boost_COMPONENT_HEADERS("${COMPONENT}" Boost_${UPPERCOMPONENT}_HEADER_NAME)
+ # Look for a standard boost header file.
+ if(Boost_${UPPERCOMPONENT}_HEADER_NAME)
+ if(EXISTS "${Boost_INCLUDE_DIR}/${Boost_${UPPERCOMPONENT}_HEADER_NAME}")
+ set(Boost_${UPPERCOMPONENT}_HEADER ON)
+ else()
+ set(Boost_${UPPERCOMPONENT}_HEADER OFF)
+ endif()
+ else()
+ set(Boost_${UPPERCOMPONENT}_HEADER ON)
+ message(WARNING "No header defined for ${COMPONENT}; skipping header check")
+ endif()
+
+ #
# Find RELEASE libraries
#
set(_boost_RELEASE_NAMES