-1

I'm adopting cmake script for a windows build, and faced with an issue which was not occured under *nix

set(BOOST_ROOT, "C:/dev/tools/boost_1_60_0")
include_directories(${INCLUDE_DIRECTORIES} ${BOOST_ROOT} include)

It doesn't work - during the compilation , vc can't find boost headers.

include_directories(${INCLUDE_DIRECTORIES} "C:/dev/tools/boost_1_60_0" include)

this works well.

any ideas why it happens?

just for sure, for this configuration pre-compiled libraries are not required so then I don't perform find_package, just using a headers

2 Answers 2

3

if it's not a typo, the "," is not needed in the set directive :

set(BOOST_ROOT "C:/dev/tools/boost_1_60_0")

this should work as expected.

1
  • man! my inattention. yes, it was a root of the issue. thanks a lot!
    – amigo421
    Jun 4, 2016 at 20:32
2

Why not FindBoost()?

find_package(Boost 1.60 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
2
  • first of all, it doesn't helpful in my case, find_package looks for a hints where boost can be installed, and hint doesn't work for me, thatis a problem. in other hand , find_package is reasonable for binary libraries only, especially when we need to build library name from a few parameters like a boost version, compiler version, etc. in case of header only libraries, BOOST_ROOT = <boost include folder>, nothing to find
    – amigo421
    Jun 4, 2016 at 20:29
  • @amigo421 You don't need hint, just add your Boost path to the CMAKE_PREFIX_PATH
    – usr1234567
    Jun 5, 2016 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.