I decided to upgrade the boost from 1.67 to 1.70. After the update, all cmake scripts linking boost stopped parsing normally and give an error:

/usr/local/lib/cmake/Boost-1.70.0/BoostConfig.cmake:95: error: Found package configuration file: /usr/local/lib/cmake/boost_system-1.70.0/boost_system-config.cmake but it set boost_system_FOUND to FALSE so package "boost_system" is considered to be NOT FOUND. Reason given by package: No suitable build variant has been found. /usr/local/lib/cmake/Boost-1.70.0/BoostConfig.cmake:124 (boost_find_dependency) /usr/local/share/cmake-3.14/Modules/FindBoost.cmake:266 (find_package) CMakeLists.txt:73 (find_package) 

On the forums, cmake found an appropriate topic, which said that to build projects with the newest boost, you need the newest cmake and for the 70th version you need cmake version 3.14. Zapulil, assembled, installed, desktop projects began to gather normally. The problem is that some of my projects use cross-compilation and build under the Linux-arm. I collected the 70th boost under the arm, tried to build the project and got the same error (i.e., updating to cmake 3.14 did not help in the case of cross-compilation).

Part of the CMake script responsible for linking arm boost:

 set (Boost_USE_STATIC_LIBS ON) # ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅ΠΌ Π² ΠΊΠ°ΠΊΠΎΠΌ Ρ€Π΅ΠΆΠΈΠΌΠ΅ Π±ΡƒΠ΄Π΅Ρ‚ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ boost Π² статичСском ΠΈΠ»ΠΈ динамичСском set (Boost_USE_MULTITHREADED OFF) # Π‘ΡƒΠ΄Π΅Ρ‚ Π»ΠΈ boost Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π² ΠΌΠ½ΠΎΠ³ΠΎΠΏΠΎΡ‚ΠΎΡ‡Π½ΠΎΠΌ Ρ€Π΅ΠΆΠΈΠΌΠ΅. set (Boost_NO_SYSTEM_PATHS ON) # Π“ΠΎΠ²ΠΎΡ€ΠΈΠΌ Ρ‡Ρ‚ΠΎ буст Π½ΡƒΠΆΠ΅Π½ Π½Π΅ ΠΈΠ· систСмной ΠΏΠ°ΠΏΠΊΠΈ set (BOOST_ROOT "/home/rivandblack/LinaroToolchain/target_lib/boost_1_70_0/") # Π“ΠΎΠ²ΠΎΡ€ΠΈΠΌ ΠΎΡ‚ΠΊΡƒΠ΄Π° Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ Π±Ρ€Π°Ρ‚ΡŒ boost find_package(Boost REQUIRED system) # Находим boost ΠΏΠΎ ссылкС BOOST_ROOT (system Ρ‚ΡƒΡ‚ ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½Π°) include_directories (SYSTEM ${Boost_INCLUDE_DIR}) # ДобавляСм ΠΏΡƒΡ‚ΠΈ link_directories(${Boost_LIBRARIES}) # ДобавляСм ΠΏΡƒΡ‚ΠΈ 

In the cmake script, note that I am replacing the system boost path so that I can "slip" the correct version of the library. I don’t know how correct this is, but before this version it always worked correctly.

By car on which the project is assembled, Kubuntu 18.04 is used; cmake 3.14.3; GCC 7.3; boost 1.70; IDE Qt Creator 4.9.0.

  • one
    faced such a problem. I did not solve it - I just rolled back to version 1.69. She does not have a similar problem - Andrej Levkovitch
  • one
    Uninstall version 1.70 and then install 1.69 - Andrej Levkovitch
  • one
    should use checkinstall - Andrej Levkovitch
  • one
    Checkinstall is not required to make - you can specify the command to install manually - Andrej Levkovitch
  • one
    @AndrejLevkovitch Problem solved. I deleted everything in the / usr / local / lib / cmake directory and it all worked. Seeing with the complete removal of cmake this directory remains intact. Thank you very much for your help. - mrFieldy

0