Alright, I'll admit right away that I don't fully understand why this is happening, or exactly why my fix in the PR prevents it from happening...
Anyway, I'm working on a few different projects which use Boost. Some use the system-wide libraries (Ubuntu 20.04LTS: sudo apt install libboost-all-dev), some use custom built versions much like Tudat.
When I open a fresh clone of tudatBundle in QTCreator, it downloads/builds Boost 1.64. Then, when progressing to CMakeLists.txt in submodule tudat/Tudat/, the line
find_package(Boost 1.45.0 ...)
fails to pick up on the version just built; instead, it seems to look in the system's include dirs:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
Found package configuration file:
/usr/lib/x86_64-linux-gnu/cmake/boost_date_time-1.71.0/boost_date_time-config.cmake
but it set boost_date_time_FOUND to FALSE so package "boost_date_time" is
considered to be NOT FOUND. Reason given by package:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_date_time.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_date_time.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
Googling around gave me the "magic flag" you see in the PR. This consistently prevents the problem on my specific system, but I reckon reproducing this on your system/github actions is going to be difficult...
At the very least, it seems to have no adverse effects on clean systems.
Not tested on Windows/Mac.