motam79
motam79

Reputation: 3824

How to tell cmake to look for Boost headers in a specified location?

I am using Boost libraries for my cmake C++ project:

find_package(Boost REQUIRED system)

Which correctly sets the Boost_INCLUDE_DIRS variable to my local Boost installation /usr/local/inlude

After I installed miniconda, which has its own boost installation, my project now looks for boost headers in

/usr/share/miniconda3/include/boost

How do I tell cmake not too look for boost headers in miniconda directories and use /usr/local/include instead?

Upvotes: 0

Views: 125

Answers (1)

Wei Guo
Wei Guo

Reputation: 564

If the two Boost library with a different version number, you can specify the Version Number in find_package cmd, like this: find_package(Boost 1.62.0 ...)

In addtion, if /usr/share/miniconda3/include/boost is not in your cmake search path, you may need: set(CMAKE_PREFIX_PATH /usr/share/miniconda3/include/boost)

Upvotes: 1

Related Questions