[CMake] Find correct boost among peers

Petr Kmoch petr.kmoch at gmail.com
Mon Feb 8 03:46:00 EST 2016


Hi Scott.

Regarding the delimiters: you'd see them if you included the dereference in
the quotes: "Boost root: ${BOOST_ROOT}". When outside quotes, the
delimiters are effectively swallowed up by message().

Regarding the main issue: I could be wrong, but from a quick glance at the
FindBoost.cmake module, it seems to me that it doesn't expect BOOST_ROOT to
contain more than one path. If it doesn't work for you without these hints,
you will maybe need to pass them in a different form. I cannot suggest one,
though; I am not versed enough in the FindBoost module.

Petr

On Mon, Feb 8, 2016 at 2:10 AM, B. Scott Harper <orcein at gmail.com> wrote:

> 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
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160208/43d3e1b7/attachment-0001.html>


More information about the CMake mailing list