Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with linking files using boost::log with CMake Buildfile
From: David Georg Reichelt (davidgeorg_reichelt_at_[hidden])
Date: 2013-12-06 07:58:53

Am 06.12.2013 00:48, schrieb Michael Chisholm:
> On 12/5/2013 4:13 PM, David Georg Reichelt wrote:
>> Hi,
>> I've got problems compiling a program using boost with CMake (using
>> Windows and MinGW 4.7.2, with -G "MinGW Makefiles"). Boost is compiled
>> normaly with b2.exe --toolset=gcc --prefix=C:\cppLib\boost_1_55_0 and
>> the folder seems to contain the right files. The original CMake-File
>> compiled fine using Ubuntu. I've got a code using only boost::log and a
>> CMake File containing the following boost-related-code:
>> ADD_DEFINITIONS("-std=c++0x")
>> SET(BOOST_ROOT "C:/cppLib/boost_1_55_0/")
>> link_libraries (${Boost_LIBRARIES})
>> find_package( Boost 1.54.0 COMPONENTS log)
>> if(Boost_FOUND)
>> MESSAGE("Boost found")
>> include_directories(${Boost_INCLUDE_DIRS})
>> add_executable(Hasselbrack ${AUTO_SOURCES})
>> endif()
> Just a quick reaction: why do you link boost libraries before you know
> whether boost was found? Would it make more sense to move
> link_libraries() into the if(Boost_FOUND) block?
> Andy
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
Thanks for the advice, you're right, that makes more sense. I changed
it, so link_libraries (${Boost_LIBRARIES}) is now in the if-block, but
unfortunately, the output is not changed.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at