0

If I build one of them then all is working well but if together then proplems begin. CMake types for each component which I want to link like that:

CMake Error at D:/Boost/lib/cmake/boost_program_options-1.78.0/libboost_program_options-variant-vc143-mt-gd-x64-1_78-static.cmake:87 (message):
  Target Boost::program_options already has an imported location
  'D:/Boost/lib/libboost_program_options-mgw8-mt-d-x64-1_78.a', which is
  being overwritten with
  'D:/Boost/lib/libboost_program_options-vc143-mt-gd-x64-1_78.lib'
  1. Boost build for MinGW using Qt enviroment:

bootstrap gcc

b2 --build-type=complete toolset=gcc variant=debug address-model=64 link=static --prefix="D:\Boost" install

  1. MSVC with Native Tools Command Prompt VS 2022:

bootstrap

b2 --build-type=complete variant=debug address-model=64 link=static --prefix="D:\Boost" install

Using Windows 10, CMake 3.21.1.

Where and what do I mistake with? Will be glad if you help me. Thanks.

  • Merging directories with `.cmake` files (`D:/Boost/lib/cmake/boost_program_options-1.78.0` in your case) would almost never work. Try to find out how to make your installations to emit `.cmake` files into different directories. – Tsyvarev Jul 25 '22 at 14:04
  • 1
    You may try making 2 separate folders for each compiler, and in cmake, where you compile YOUR project, just [detect compiler](https://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang) and based on this knowledge use appropriate path to boost – Deumaudit Jul 25 '22 at 14:09
  • Thanks, I know that two different directories may become a outcome but I am really interested in one. Or is it impossible? – Andrey Korostin Jul 26 '22 at 06:38

0 Answers0