<div dir="ltr">I guess it doesn't really matter but for the libraries that don't have a single include header, should you be using these instead:<br><ul><li>container/container_fwd.hpp</li><li>exception/all.hpp</li><li>filesystem.hpp</li><li>math_fwd.hpp (instead of math/quaternion.hpp)</li><li>system/config.hpp</li><li>type_erasure/config.hpp</li></ul><p>They're "common" or "central" headers for the libraries instead of specific headers.<br></p></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">- Chuck<br></div></div></div>
<br><div class="gmail_quote">On Wed, May 11, 2016 at 10:38 AM,  <span dir="ltr"><<a href="mailto:rleigh@codelibre.net" target="_blank">rleigh@codelibre.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2016-04-12 11:22, Joachim Wuttke wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
FindBoost does not detect absence of header files.<br>
<br>
To be specific: Run the following under cmake version 3.5.1:<br>
<br>
set(Boost_NO_BOOST_CMAKE ON) # prevent shortcut<br>
set(Boost_USE_STATIC_LIBS OFF)<br>
set(Boost_USE_MULTITHREADED ON)<br>
set(Boost_USE_STATIC_RUNTIME OFF)<br>
add_definitions(-DBOOST_ALL_DYN_LINK) # line is needed for MSVC<br>
#add_definitions(-DBOOST_LIB_DIAGNOSTIC) # shows during compilation<br>
auto-linked libraries<br>
if(WIN32)<br>
    set(boost_libraries_required date_time chrono program_options zlib<br>
bzip2 iostreams system filesystem regex thread)<br>
else()<br>
    set(boost_libraries_required date_time chrono program_options<br>
iostreams system filesystem regex thread)<br>
endif()<br>
find_package(Boost 1.48.0 COMPONENTS ${boost_libraries_required} REQUIRED)<br>
message(STATUS "--> Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")<br>
message(STATUS "    Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")<br>
message(STATUS "    Boost_LIBRARIES: ${Boost_LIBRARIES}")<br>
<br>
It will pass, even if files like /usr/include/boost/date_time.hpp &c are removed<br>
from the system.<br>
</blockquote>
<br></div></div>
Attached is a patch to add this extra checking.<br>
<br>
For each library component, there is a corresponding header which has been present in all versions of boost to date which provide the library; the list used to validate this is also attached.  I have also validated that each component works with find_package for Boost 1.58 and 1.60.<br>
<br>
If your system contains both the libraries and headers, then FindBoost will behave exactly as before.  But if you have the libraries without the headers, FindBoost will now fail, rather than passing and then having the build subsequently fail when it tries to use the nonexistent headers.  So it's essentially adding an additional header check per component, which will identify situations where the user has an incomplete Boost installation e.g. no all the -dev packages are installed.<br>
<br>
I can merge this into next for testing, but if anyone wanted to have an initial play with it to verify that it's still functional and that the approach is sound, I can wait off for now.<br>
<br>
<br>
Regards,<br>
Roger<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake-developers</a><br></blockquote></div><br></div>