Boost logo

Boost Users :

Subject: Re: [Boost-users] makefile
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2009-08-26 12:44:03


Hi,

2009/8/26 Alfredo Correa <alfredo.correa_at_[hidden]>

> > 2009/8/25 Chris Uzdavinis <cuz..._at_[hidden]>
> > CMake is of great help for that!
>
> thank you,
> can you give a one or two line example on how use cmake to choose the
> right boost library file?

Here is an example:

project( MyProject )

set( Boost_ADDITIONAL_VERSIONS "1.38.0" "1.39.0" )
set( Boost_USE_STATIC_LIBS OFF )
set( Boost_USE_MULTITHREAD ON )
find_package( Boost 1.36.0 REQUIRED )
if( Boost_FOUND )
    include_directories( ${Boost_INCLUDE_DIR} )
    link_directories( ${Boost_LIBRARY_DIR} )
else()
    message( FATAL_ERROR "Boost not found ! Please set Boost directories !"
)
endif()

add_executable( projectbinary myproject.cpp )
target_link_libraries( projectbinary ${Boost_LIBRARIES} )

Have a look at cmake documentation for more details (
http://www.cmake.org/cmake/help/cmake2.6docs.html and in particular
http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindBoost).

Regards,

Olivier

>
>
> Alfredo
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net