[CMake] Find correct boost among peers

B. Scott Harper orcein at gmail.com
Sun Feb 7 20:10:28 EST 2016


I have several versions of boost downloaded on my machine inside a
"thirdparty" directory. Different projects rely on various versions.

I am trying to find a later version than the first version in that
collection. I have gotten the closest by using a file(GLOB ...) as follows:

file(GLOB BOOST_ROOT ${THIRD_PARTY_DIR}/boost_*)
find_package(Boost
  1.60.0
  REQUIRED)

...but if I have any versions of Boost earlier than 1.60.0 in this case, it
will find only the first directory, recognize that it's too early, and bail
out without trying any other directories.

When I print out the results of the GLOB action using message(STATUS "Boost
root: " ${BOOST_ROOT}), I don't see any delimiters in the string, and I
wonder if this it causing the problem? Is this expected beahiour or am I
using this incorrectly?

Cheers,
-- Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160208/0c185519/attachment.html>


More information about the CMake mailing list