Can't find Boost with Visual Studio 2017

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't find Boost with Visual Studio 2017

David Demelier-2
Hello all,

I've built Booost 1.66 on Windows with Visual Studio 2017 using the
following invocation:

     .\b2
         link=shared
         runtime-link=shared
         threading=multi
         toolset=msvc
         variant=debug
         address-model=64
         install --prefix=C:/env/vs/amd64d

Then, the C:/env/vs/amd64d tree is filled like this:

   - lib/boost_timer-vc141-mt-gd-x64-1_66.lib (and so on)
   - include/boost-1_66/boost/{asio/assign,...}

I create a sample CMake project:

     cmake_minimum_required(VERSION 3.5)
     project(foo)
     find_package(Boost REQUIRED COMPONENTS timer)

I set CMAKE_PREFIX_PATH and run CMake

     set CMAKE_PREFIX_PATH=C:/env/vs/amd64d/
     cmake . -G "Visual Studio 15 2017 Win64"

     [...]
-- Detecting CXX compile features - done
CMake Warning at C:/Program
Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
   Imported targets and dependency information not available for Boost
version
   (all versions older than 1.33)
Call Stack (most recent call first):
   C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:907
(_Boost_COMPONENT_DEPENDENCIES)
   C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1542
(_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:3 (find_package)


CMake Error at C:/Program
Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
   Unable to find the requested Boost libraries.

   Unable to find the Boost header files.  Please set BOOST_ROOT to the
root
   directory containing Boost or BOOST_INCLUDEDIR to the directory
containing
   Boost's headers.
Call Stack (most recent call first):
   CMakeLists.txt:3 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/markand/Documents/test/CMakeFiles/CMakeOutput.log".

I can't understand what I am missing because it's not the first time I
use boost on Windows though. I've tried set BOOST_ROOT to the same value
as CMAKE_PREFIX_PATH with no results.

--
David Demelier
--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Can't find Boost with Visual Studio 2017

Volker Enderlein
Hi David,

Boost changed its naming scheme starting from version 1.66. So its not
your fault but the FindBoost.cmake does not know how to handle the new
scheme. Try to use one of the 3.11.0-rc[1-3] versions that has the
proper naming scheme handling of 1.66 or use the 1.65.1 that is the last
version with the old naming scheme.

Cheers Volker

Am 17.03.2018 um 21:29 schrieb David Demelier:

> Hello all,
>
> I've built Booost 1.66 on Windows with Visual Studio 2017 using the
> following invocation:
>
>      .\b2
>          link=shared
>          runtime-link=shared
>          threading=multi
>          toolset=msvc
>          variant=debug
>          address-model=64
>          install --prefix=C:/env/vs/amd64d
>
> Then, the C:/env/vs/amd64d tree is filled like this:
>
>    - lib/boost_timer-vc141-mt-gd-x64-1_66.lib (and so on)
>    - include/boost-1_66/boost/{asio/assign,...}
>
> I create a sample CMake project:
>
>      cmake_minimum_required(VERSION 3.5)
>      project(foo)
>      find_package(Boost REQUIRED COMPONENTS timer)
>
> I set CMAKE_PREFIX_PATH and run CMake
>
>      set CMAKE_PREFIX_PATH=C:/env/vs/amd64d/
>      cmake . -G "Visual Studio 15 2017 Win64"
>
>      [...]
> -- Detecting CXX compile features - done
> CMake Warning at C:/Program
> Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
>    Imported targets and dependency information not available for Boost
> version
>    (all versions older than 1.33)
> Call Stack (most recent call first):
>    C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:907
> (_Boost_COMPONENT_DEPENDENCIES)
>    C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1542
> (_Boost_MISSING_DEPENDENCIES)
>    CMakeLists.txt:3 (find_package)
>
>
> CMake Error at C:/Program
> Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
>    Unable to find the requested Boost libraries.
>
>    Unable to find the Boost header files.  Please set BOOST_ROOT to the
> root
>    directory containing Boost or BOOST_INCLUDEDIR to the directory
> containing
>    Boost's headers.
> Call Stack (most recent call first):
>    CMakeLists.txt:3 (find_package)
>
>
> -- Configuring incomplete, errors occurred!
> See also "C:/Users/markand/Documents/test/CMakeFiles/CMakeOutput.log".
>
> I can't understand what I am missing because it's not the first time I
> use boost on Windows though. I've tried set BOOST_ROOT to the same value
> as CMAKE_PREFIX_PATH with no results.
>

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Can't find Boost with Visual Studio 2017

David Demelier-2
On Sat, 2018-03-17 at 23:15 +0100, Volker Enderlein wrote:

> Hi David,
>
> Boost changed its naming scheme starting from version 1.66. So its
> not
> your fault but the FindBoost.cmake does not know how to handle the
> new
> scheme. Try to use one of the 3.11.0-rc[1-3] versions that has the
> proper naming scheme handling of 1.66 or use the 1.65.1 that is the
> last
> version with the old naming scheme.
>

Hello,

Indeed, it works with CMake 3.11, thanks a lot :)

--
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:
https://cmake.org/mailman/listinfo/cmake