FindBoost: Prints wrong version/components and disrespects `QUIET`, when using Boost CMake package
Bug: When having Boost installed with its own CMake package (which seems to be the default since Boost 1.70.0
),
-
FindBoost.cmake
may print wrong status messages. - Also, those status messages are not respecting the
${Boost_FIND_QUIETLY}
flag.
Example: When having Boost 1.70.0
installed, a
find_package(Boost 1.67 QUIET REQUIRED COMPONENTS program_options container OPTIONAL_COMPONENTS foobar)
results in
-- Found Boost 1.70.0 at /home/dklein/boost_1_70_0_install/lib/cmake/Boost-1.70.0
-- Requested configuration: QUIET REQUIRED COMPONENTS program_options;container OPTIONAL_COMPONENTS foobar
-- Found boost_headers 1.70.0 at /home/dklein/boost_1_70_0_install/lib/cmake/boost_headers-1.70.0
-- Found boost_program_options 1.70.0 at /home/dklein/boost_1_70_0_install/lib/cmake/boost_program_options-1.70.0
-- libboost_program_options.a
-- Adding boost_program_options dependencies: headers
-- Found boost_container 1.70.0 at /home/dklein/boost_1_70_0_install/lib/cmake/boost_container-1.70.0
-- libboost_container.a
-- Adding boost_container dependencies: headers
-- Boost 1.67 found.
-- Found Boost components:
program_options;container;foobar
None of the above should be printed, because QUIET
was passed (The first 9 lines are printed by the CMake package and the issue is reported upstream). The last 3 lines are printed by FindBoost.cmake
and contain wrong version number and a wrong list of components.
(Example output produced with CMake 3.12.1
on Fedora 29, but looking at the code, I believe, the bug is still present in master
)