[CMake] Boost library directory not found unless I explicitly set BOOST_LIBRARYDIR ?

David Cole DLRdave at aol.com
Fri Nov 14 14:40:23 EST 2014


You will find a list of CMake "Module Maintainers" here:
http://www.cmake.org/Wiki/CMake:Module_Maintainers

If a module is not listed, it is not currently claimed. (Meaning
either nobody is currently maintaining it, or "everybody" is pitching
in a little bit as things important to them arise.)

Unfortunately, FindBoost is among the maintainer-less modules at present...

However, ... patches are welcome. :-)


HTH,
David C.


On Fri, Nov 14, 2014 at 2:09 PM, Glenn Coombs <glenn.coombs at gmail.com> wrote:
> Ryan,
>
> Thanks for the helper script - I'll try that out on Monday.
>
> Does anybody know if the FindBoost.cmake file is maintained by the CMake
> developers, or does it have a 3rd party maintainer ?  It would be nice to
> see some logic similar to your script incorporated by default so that other
> people experience the simplicity of it just working straight out of the box.
>
> --
> Glenn
>
> On 14 November 2014 16:23, Ryan Pavlik <ryan.pavlik at gmail.com> wrote:
>>
>> I've used a script to help it out a bit. I think these Windows installers
>> are new.  Here's the script I use - it basically sets BOOST_ROOT and
>> BOOST_LIBRARYDIR automatically in some cases.
>> https://gist.github.com/rpavlik/586f1fda6e32777623e1
>>
>> Ryan
>>
>> On Fri, Nov 14, 2014 at 6:56 AM, Glenn Coombs <glenn.coombs at gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I have installed Boost on Windows 7 for Visual Studio 2013 by running
>>> these installers:
>>>
>>> boost_1_56_0-msvc-12.0-32.exe
>>> boost_1_56_0-msvc-12.0-64.exe
>>>
>>> downloaded from
>>> http://sourceforge.net/projects/boost/files/boost-binaries/1.56.0/.
>>>
>>> I'm using CMake 2.8.12.1 and when I try to build a simple Boost example
>>> using the filesystem library my cmake configuration step fails to find the
>>> required libraries unless I use the BOOST_LIBRARYDIR variable to tell it
>>> where the libraries are:
>>>
>>> set(BOOST_VERSION_NEEDED 1.53.0)
>>>
>>> if (MSVC)
>>>     set(Boost_USE_STATIC_LIBS       ON)
>>>     set(Boost_USE_MULTITHREADED     ON)
>>>     set(Boost_USE_STATIC_RUNTIME    ON)
>>> #   set(BOOST_LIBRARYDIR            /Boost/boost_1_56_0/lib64-msvc-12.0)
>>> endif()
>>>
>>> find_package(Boost ${BOOST_VERSION_NEEDED} REQUIRED COMPONENTS system
>>> filesystem)
>>>
>>> Given that the library directory is where the official Boost installer
>>> put it shouldn't the FindBoost.cmake package be checking that directory by
>>> default ?
>>>
>>> This is the output from CMake:
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:476 ] _boost_TEST_VERSIONS =
>>> 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:478 ] Boost_USE_MULTITHREADED =
>>> ON
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:480 ] Boost_USE_STATIC_LIBS = ON
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:482 ] Boost_USE_STATIC_RUNTIME =
>>> ON
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:484 ] Boost_ADDITIONAL_VERSIONS
>>> =
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:486 ] Boost_NO_SYSTEM_PATHS =
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Declared as CMake or
>>> Environmental Variables:
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:540 ] BOOST_ROOT =
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:542 ] BOOST_INCLUDEDIR =
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:544 ] BOOST_LIBRARYDIR =
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:546 ] _boost_TEST_VERSIONS =
>>> 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:639 ] location of version.hpp:
>>> C:/Boost/boost_1_56_0/boost/version.hpp
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:663 ] version.hpp reveals boost
>>> 1.56.0
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:739 ] guessed _boost_COMPILER =
>>> -vc120
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:749 ] _boost_MULTITHREADED = -mt
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:792 ] _boost_RELEASE_ABI_TAG =
>>> -s
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:794 ] _boost_DEBUG_ABI_TAG =
>>> -sgd
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:842 ] _boost_LIBRARY_SEARCH_DIRS
>>> =
>>> C:/Boost/boost_1_56_0/lib;C:/Boost/boost_1_56_0/../lib;C:/Boost/boost_1_56_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:930 ] Searching for
>>> SYSTEM_LIBRARY_RELEASE:
>>> libboost_system-vc120-mt-s-1_56;libboost_system-vc120-mt-s;libboost_system-mt-s-1_56;libboost_system-mt-s;libboost_system
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:966 ] Searching for
>>> SYSTEM_LIBRARY_DEBUG:
>>> libboost_system-vc120-mt-sgd-1_56;libboost_system-vc120-mt-sgd;libboost_system-mt-sgd-1_56;libboost_system-mt-sgd;libboost_system-mt;libboost_system
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:930 ] Searching for
>>> FILESYSTEM_LIBRARY_RELEASE:
>>> libboost_filesystem-vc120-mt-s-1_56;libboost_filesystem-vc120-mt-s;libboost_filesystem-mt-s-1_56;libboost_filesystem-mt-s;libboost_filesystem
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:966 ] Searching for
>>> FILESYSTEM_LIBRARY_DEBUG:
>>> libboost_filesystem-vc120-mt-sgd-1_56;libboost_filesystem-vc120-mt-sgd;libboost_filesystem-mt-sgd-1_56;libboost_filesystem-mt-sgd;libboost_filesystem-mt;libboost_filesystem
>>>
>>> [ C:/Program Files (x86)/CMake
>>> 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1017 ] Boost_FOUND = 1
>>>
>>> Could NOT find Boost
>>>
>>> Boost version: 1.56.0
>>>
>>> Boost include path: C:/Boost/boost_1_56_0
>>>
>>> Could not find the following static Boost libraries:
>>>
>>> boost_system
>>>
>>> boost_filesystem
>>>
>>> No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to
>>> the directory containing Boost libraries or BOOST_ROOT to the location of
>>> Boost.
>>>
>>>
>>> As you can see it is looking for a directory called lib rather than
>>> lib64-msvc-12.0.
>>>
>>> --
>>> Glenn
>>>
>>> --
>>>
>>> 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


More information about the CMake mailing list