[CMake] FindBoost.cmake to find the boost libraries

Chauhan, Vikas vikas.chauhan at anritsu.com
Sun Jan 10 14:55:44 EST 2010



> -----Original Message-----
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On
Behalf
> Of Andreas Pakulat
> Sent: 10 January 2010 17:51
> To: cmake at cmake.org
> Subject: Re: [CMake] FindBoost.cmake to find the boost libraries
> 
> On 10.01.10 15:57:23, Chauhan, Vikas wrote:
> > Hi all,
> >
> > I am using the code below in cmakelists.txt to find the boost
libraries
> > using cmake 2.8.
> > After the execution "Boost_LIBRARIES" does not contain anything. Am
I
> > correct in assuming that this variable must be populated with the
list
> > of boost libraries?
> 
> No you're not correct. The problem is that you're using the
> FindBoost.cmake module in the wrong way. You're supposed to use
> 
> find_package(Boost <options>)
> 
> where options include the boost libs you want to use. See the top of
> FindBoost.cmake for an example how to use it.
> 

Thanks, I tried "find_package" and it works now.

I had tried "find_package" earlier and did not work. Probably, because I
had to set the BOOST_LIBRARYDIR correctly as it is a non-standard one in
my environment. So, adding these two commands makes boost work:
set (BOOST_LIBRARYDIR  "C:/Program Files/boost1.35.0/lib_vc90")
find_package( Boost 1.35.0 COMPONENTS system)

However, do you know the use of "Boost_FIND_COMPONENTS" command. There
is no documentation for it at present. Is it a deprecated command?

Vikas

> Andreas
> 
> --
> The whole world is a tuxedo and you are a pair of brown shoes.
> 		-- George Gobel
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list