This is a confusing feature from check_cxx_source_compiles. From the
documentation related to the usage of CMAKE_REQUIRED_DEFINITIONS
(which is NOT used!):
A definition for the name specified by <resultVar> will also be added automatically.
What this means is that the check for BOOST_TEST_DYN_LINK will build
with a -DBOOST_TEST_DYN_LINK flag, because the result variable is also
named BOOST_TEST_DYN_LINK. This in turns cause the check to fail with
-Werror due to a GCC redefinition warning being promoted to error.
This diff renames the output variable to prevent this redefinition. It
also makes the check easier to read. This has no impact on the behavior
without an additional -Werror flag.