From: Peter Dimov (pdimov_at_[hidden])
Date: 2020-09-15 17:28:27


Andrey Semashev wrote:

> I'm not sure, but I think the above would generate incorrect order of
> libraries in the linker command line. You need to ensure that boost_log
> comes after boost_log_setup, and their dependencies come after still.

CMake automatically orders libraries so that the dependencies come after.
Unfortunately, FindBoost has a bug and declares log as depending on
log_setup, rather than vice versa.

https://github.com/Kitware/CMake/blob/bdcde7762c71cd27fcba6dc1a3efe12fa7a09fef/Modules/FindBoost.cmake#L1177

No matter how you order the libraries in target_link_libraries, the order
between these two will never be correct.

Not sure if this is the problem here though.