[CMake] cmake and boost

Ryan Pavlik rpavlik at iastate.edu
Fri Mar 19 15:24:42 EDT 2010


On Fri, Mar 19, 2010 at 2:17 PM, James C. Sutherland <
James.Sutherland at utah.edu> wrote:

> >
> > include_directories(
> >       boost/src
> >       boost/build/lib/Exports.cmake
> >       )
> >
> I think that you want
>
>        include( boost/build/lib/Exports.cmake )
>
> instead.  Also, you will need to specify the full path to the boost
> directory.
>


Why not just let the user decide where they'd like to get boost, and
simplify your build system by just using find_package(Boost)?

For example, this is all you need for a simple boost-using app...

find_package(Boost 1.34.0 REQUIRED COMPONENTS filesystem system)
include_directories(${Boost_INCLUDE_DIR})
add_executable(yourapp yourapp.cpp)
target_link_libraries(yourapp ${Boost_LIBRARIES})


-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100319/ed622326/attachment.htm>


More information about the CMake mailing list