[CMake] FindBoost not finding MinGW libraries

Sergei Nikulov sergey.nikulov at gmail.com
Mon Nov 14 10:00:28 EST 2016


14 ноя 2016 г. 4:36 PM пользователь "David Demelier" <
demelier.david at gmail.com> написал:
>
> Hello,
>
> I've installed boost under C:\env\mingw64 so I basically have the
> following content:
>
> - C:\env\mingw64\include\boost-1_62\boost\*
> - C:\env\mingw64\lib\libboost_libname-mgw62-1_62.dll(.a)
>
> I've also set the following environment variables:
>
> - BOOST_INCLUDEDIR=C:\env\mingw64\include\boost-1_62
> - BOOST_LIBRARYDIR=C:\env\mingw64\lib
> - BOOST_ROOT=C:\env\mingw64
>
> The following CMakeLists could not find boost:
>
> cmake_minimum_required(VERSION 3.5)
> project(boosttest)
> find_package(Boost REQUIRED COMPONENTS system)
>
> running cmake -G"MinGW Makefiles" -DBoost_DEBUG=On ends with this:
>
> -- The C compiler identification is GNU 6.2.0
> -- The CXX compiler identification is GNU 6.2.0
> -- Check for working C compiler: C:/mingw64/bin/gcc.exe
> -- Check for working C compiler: C:/mingw64/bin/gcc.exe -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: C:/mingw64/bin/g++.exe
> -- Check for working CXX compiler: C:/mingw64/bin/g++.exe -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:946 ]
> _boost_TEST_VERSIONS =
>
1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;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
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:948 ]
> Boost_USE_MULTITHREADED = TRUE
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:950 ]
> Boost_USE_STATIC_LIBS =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:952 ]
> Boost_USE_STATIC_RUNTIME =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:954 ]
> Boost_ADDITIONAL_VERSIONS =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:956 ]
> Boost_NO_SYSTEM_PATHS =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1024 ] Declared as
> CMake or Environmental Variables:
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1026 ]
> BOOST_ROOT =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1028 ]
> BOOST_INCLUDEDIR =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1030 ]
> BOOST_LIBRARYDIR =
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1032 ]
> _boost_TEST_VERSIONS =
>
1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;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
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1101 ] Include
> debugging info:
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1103 ]
> _boost_INCLUDE_SEARCH_DIRS =
>
C:/env/mingw64/include/boost-1_62;C:/env/mingw64/include;C:/env/mingw64;PATHS;C:/boost/include;C:/boost;/sw/local/include
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1105 ]
> _boost_PATH_SUFFIXES =
>
boost-1_61_0;boost_1_61_0;boost/boost-1_61_0;boost/boost_1_61_0;boost-1_61;boost_1_61;boost/boost-1_61;boost/boost_1_61;boost-1_60_0;boost_1_60_0;boost/boost-1_60_0;boost/boost_1_60_0;boost-1_60;boost_1_60;boost/boost-1_60;boost/boost_1_60;boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-
>
 1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_
>
 0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boo
>
 st/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1125 ] location of
> version.hpp: C:/env/mingw64/include/boost-1_62/boost/version.hpp
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1149 ] version.hpp
> reveals boost 1.62.0
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1235 ] guessed
> _boost_COMPILER = -mgw62
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1245 ]
> _boost_MULTITHREADED = -mt
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1288 ]
> _boost_RELEASE_ABI_TAG = -
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1290 ]
> _boost_DEBUG_ABI_TAG = -d
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1344 ]
> _boost_LIBRARY_SEARCH_DIRS_RELEASE =
>
C:/env/mingw64/lib;C:/env/mingw64/lib;C:/env/mingw64/stage/lib;C:/env/mingw64/include/boost-1_62/lib;C:/env/mingw64/include/boost-1_62/../lib;C:/env/mingw64/include/boost-1_62/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG
>   =
C:/env/mingw64/lib;C:/env/mingw64/lib;C:/env/mingw64/stage/lib;C:/env/mingw64/include/boost-1_62/lib;C:/env/mingw64/include/boost-1_62/../lib;C:/env/mingw64/include/boost-1_62/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
> CMake Warning at C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:743 (message):
>   Imported targets not available for Boost version 106200
> Call Stack (most recent call first):
>   C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:842
> (_Boost_COMPONENT_DEPENDENCIES)
>   C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1395
> (_Boost_MISSING_DEPENDENCIES)
>   CMakeLists.txt:3 (find_package)
>
>
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1483 ] Searching
> for SYSTEM_LIBRARY_RELEASE:
>
boost_system-mgw62-mt-1_62;boost_system-mgw62-mt;boost_system-mt-1_62;boost_system-mt;boost_system
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1525 ] Searching
> for SYSTEM_LIBRARY_DEBUG:
>
boost_system-mgw62-mt-d-1_62;boost_system-mgw62-mt-d;boost_system-mt-d-1_62;boost_system-mt-d;boost_system-mt;boost_system
> -- [ C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1595 ] Boost_FOUND
> = 1
> CMake Error at C:/Program
> Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
>   Unable to find the requested Boost libraries.
>
>   Boost version: 1.62.0
>
>   Boost include path: C:/env/mingw64/include/boost-1_62
>
>   Could not find the following Boost libraries:
>
>           boost_system
>
>   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.
> Call Stack (most recent call first):
>   CMakeLists.txt:3 (find_package)
>
>
> -- Configuring incomplete, errors occurred!
> See also
"C:/Users/S0077863/Desktop/boost/build/CMakeFiles/CMakeOutput.log".
>
> What's wrong? Do I need another variable?
>

Add option -DBoost_ADDITIONAL_VERSIONS="1.62.00;1.62" to command line
or
Update you findboost.cmake module from CMake repository.

>
> --
> Demelier David
> --
>
> 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/20161114/2359a8e6/attachment-0001.html>


More information about the CMake mailing list