FindBoost: Cmake switches to unthreaded boost libraries when building makefiles on one machine, but not on other
When my colleague attempts to build my cmake project on his computer he gets errors that appear to be caused by cmake finding the threaded and unthreaded boost libraries.
We are both on OSX, he on 10.10, me on 10.14. We have compared our installation versions of cmake, python, homebrew, etc without finding a definitive difference that would explain this behaviour of cmake. Also nothing on stackoverflow, etc.
Here is an example from 'broken-build.log':
-- Scanning /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant*.cmake
-- Including /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant-mt-shared.cmake
-- [ ] libboost_chrono-mt.dylib
-- Including /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant-mt-static.cmake
-- [x] libboost_chrono-mt.a
-- Including /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant-shared.cmake
-- [ ] libboost_chrono.dylib
-- Including /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant-static.cmake
-- [x] libboost_chrono.a
CMake Warning at /usr/local/lib/cmake/boost_chrono-1.71.0/libboost_chrono-variant-static.cmake:59 (message):
Target Boost::chrono already has an imported location
'/usr/local/lib/libboost_chrono-mt.a', which will be overwritten with
'/usr/local/lib/libboost_chrono.a'
I have added Boost_USE_MULTITHREADED before the FIND_PACKAGE command:
set( Boost_USE_MULTITHREADED ON )
FIND_PACKAGE(Boost 1.62.0 REQUIRED COMPONENTS atomic chrono filesystem log log_setup regex system thread REQUIRED)
without any improvement.
I have attached the CMakeLists.txt file, and logs from broken and working builds.
Edited by Brad King