This relied on internal CMake variables and did not detected all
compiler and flag changes which could influence library search changes.
Users should clear the build directory when making such config changes.
This was needed with older CMake versions to work around CMake searching
under lib with -m32 instead of under lib32 for platforms where lib
contains 64-bit binaries. This has since been fixed in CMake and users
of older CMake versions can add the lib32 directories to
CMAKE_LIBRARY_PATH to work around the issue on their end.
With newer CMake and Boost versions these checks fail because the
boost-config.cmake files shipped with Boost use imported targets instead
of library paths and try_compile does not add these imported targets to
the generated project.
See: https://gitlab.kitware.com/cmake/cmake/issues/11260
std::bitset constructor was ambiguous because in C++11 the parameter
changed from unsigned long to unsigned long while MSVC violates the
standard by also having a constructor taking an int parameter.
* SET_WARNING_FLAGS for warning options (don't affect binaries)
* SET_OPTIMIZATION_FLAGS for compiler & linker optimization options
Also, re-enable some warnings that were disabled and instead suppress
them for the individual occurences.