Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get rid of the "New Boost version may have incorrect or missing dependencies and imported targets" warning?

Tags:

boost

cmake

I am using CMake and Boost. I am using Boost 1.68.0 and CMake 3.11.0. I cannot upgrade to newer versions of CMake as cotire prevents moc files from being generated on CMake 3.12.0 and onwards. However, this causes the following warning: New Boost version may have incorrect or missing dependencies and imported targets. Everything works fine and it finds the right files, but this warning is rather annoying. Is there a way to disable this warning while keeping the current version of Boost and CMake?

like image 310
JigsawCorp Avatar asked Aug 08 '19 14:08

JigsawCorp


2 Answers

To get rid of the warning, you need to check your FindBoost.cmake file present in <your_path>\CMake\share\cmake-3.19\Modules

Open your your command prompt, cd into the above directory, then open the FindBoost.cmake file by typing:

notepad FindBoost.cmake

In the file, you will find an if else statement with the your above stated warning. Inspect it then, from that you can figure out which version of boost will NOT give you the warning, then use that version.

Hope this would help !

like image 189
asif Avatar answered Oct 02 '22 14:10

asif


cmake ... -DBoost_NO_WARN_NEW_VERSIONS=1
like image 34
Ying Dai Avatar answered Oct 02 '22 13:10

Ying Dai