[CMake] Expected boost path structure.

John Drescher drescherjm at gmail.com
Thu Feb 17 11:46:24 EST 2011


On Thu, Feb 17, 2011 at 11:37 AM, John Drescher <drescherjm at gmail.com> wrote:
>> According to FindBoost.cmake:
>>
>>  if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
>>    set(BOOST_ROOT $ENV{BOOST_ROOT})
>>  endif()
>>
>> So, it should work with an ENV var, too. But the way this is phrased,
>> it would have to have forward slashes "/" and no spaces in it for it
>> to work.
>>
>
> I launched cmake-gui from a Visual Studio 2008 32 bit command prompt
> with the BOOST_ROOT environment variable set in that command prompt.
>
> X:\Other\Libraries\boost_1_45_0>set BOOST_ROOT
> BOOST_ROOT="X:/32bit/VC.90/Libraries/boost-1.45.0"
>
> Is there a way to have cmake-gui show its environment variables?
>

Here is some debug output.

Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
BOOST_ROOTENV="X:/32bit/VC.90/Libraries/boost-1.45.0"
BOOST_ROOTCMake=
Could NOT find Boost
Configuring done

This was generated with the following CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)

PROJECT(BoostExamples)

MESSAGE( STATUS BOOST_ROOT ENV = $ENV{BOOST_ROOT} )
MESSAGE( STATUS BOOST_ROOT CMake = ${BOOST_ROOT} )


# The following line will add additional finders to CMake without the
need to be placed in the CMake install path
#LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules)

#SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all libraries.")
#SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all executables.")

#set(BOOST_ROOT "X:/32bit/VC.90/Libraries/boost-1.45.0")
FIND_PACKAGE(BOOST REQUIRED)

Now with #set(BOOST_ROOT "X:/32bit/VC.90/Libraries/boost-1.45.0")
uncommented, cache dropped and reconfigured:
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
BOOST_ROOTENV="X:/32bit/VC.90/Libraries/boost-1.45.0"
BOOST_ROOTCMake=
Boost version: 1.45.0
Configuring done

John


More information about the CMake mailing list