[CMake] figuring out exact name of boost-regex lib to use

Michael Wild themiwi at gmail.com
Tue Feb 28 08:02:37 EST 2012


Hi Bart

Please keep answers on the list, so others can also profit from the
discussion.

On 02/28/2012 01:59 PM, Bart Vandewoestyne wrote:
> On 02/28/2012 10:28 AM, Michael Wild wrote:
>> Don't do it this way. Use this:
>>
>> find_package(Boost REQUIRED COMPONENTS regex)
>> include_directories(${Boost_INCLUDE_DIRS})
>>
>> # add_executable etc...
>>
>> target_link_libraries(airspace ${Boost_LIBRARIES})
> 
> Michael,
> 
> Thanks for pointing me to the find_package command!  One more
> detail-question however: in the docs online at
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package
> is the syntax written as:
> 
>   find_package(<package> [version] [EXACT] [QUIET]
>                [[REQUIRED|COMPONENTS] [components...]]
>                [NO_POLICY_SCOPE])
> 
> Notice the [REQUIRED|COMPONENTS] from which i deduce that the
> find_package command should probably be written as
> 
>   find_package(Boost REQUIRED regex)
> 
> I tried it, and it seems to work...
> 
> Kind regards,
> Bart

You are absolutely right, I wrote my reply from memory, and got it
obviously wrong ;-)

Michael


More information about the CMake mailing list