[CMake] Find correct boost among peers
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
Re: [CMake] Find correct boost among peers
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 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 > -- 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
Re: [CMake] Find correct boost among peers
Scott, Rather than having the versions fight one another in BOOST_ROOT, you might consider modifying the CMAKE_PREFIX_PATH to include the versions of boost you have - find_package will search there first (you might be able with just giving it the parent of the boost version). If you set the version and EXACT in the find_package call, each project should be able to find its version. You may also want to look at Boost_NO_SYSTEM_PATHS to ensure the FindBoost module isn't hunting around in places you don't intend. mj > Date: Mon, 8 Feb 2016 09:46:00 +0100 > From: Petr Kmoch > To: "B. Scott Harper" > Cc: "cmake@cmake.org" > Subject: Re: [CMake] Find correct boost among peers > Message-ID: >@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > 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 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