0

I worked through CMake no longer finds static Boost libraries and CMake not finding Boost and some of the other related questions.

I've the same problem, but none of the solutions are suitable for me.

running cmake -DBoost_DEBUG=ON . leads to

Building external libraries
-- [ /usr/local/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;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:478 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:480 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:482 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:484 ] Boost_ADDITIONAL_VERSIONS =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:486 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:538 ] Declared as CMake or Environmental Variables:
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:540 ]   BOOST_ROOT =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:542 ]   BOOST_INCLUDEDIR =
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:544 ]   BOOST_LIBRARYDIR =
-- [ /usr/local/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;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:639 ] location of version.hpp: /usr/local/include/boost-1_54/boost/version.hpp
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:663 ] version.hpp reveals boost 1.54.0
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:739 ] guessed _boost_COMPILER = -gcc43
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:749 ] _boost_MULTITHREADED = -mt
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:792 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:794 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:842 ] _boost_LIBRARY_SEARCH_DIRS = /usr/local/include/boost-1_54/lib;/usr/local/include/boost-1_54/../lib;/usr/local/include/boost-1_54/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib

Boost version and boost headers are found, the static libraries aren't. they are all located in /usr/local/lib64 but this path isn't included in _boost_LIBRARY_SEARCH_DIRS.

I'm using cmake version 2.8.12.2 on sles11 sp2 x86_64.

Question is: how is cmake's _boost_LIBRARY_SEARCH_DIRS set/configured/influenced?

UPDATE

In fact I had two problems, one solved by the answer below, the second was a wrong

guessed _boost_COMPILER = -gcc43

which I could solve via SET( Boost_COMPILER -gcc48)

Community
  • 1
  • 1
Disc-Addict
  • 138
  • 12

1 Answers1

1

Make sure that the global property FIND_LIBRARY_USE_LIB64_PATHS is set to true before calling find_package(Boost), i.e.:

set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)

This should make the find_library call in CMake's boost module honor the /usr/local/lib64 directory.

sakra
  • 62,199
  • 16
  • 168
  • 151
  • Explicitly stating what is in the documentation, if `find_library` is looking in `/usr/local/lib/package`, by setting `FIND_LIBRARY_USE_LIB64_PATHS` to true, it will look in `/usr/local/lib64/package`, `/usr/local/lib/package/64`, and `/usr/local/lib64/package/64` for your libraries. – PfunnyGuy Sep 15 '17 at 16:19