[CMake] link_libraries vs target_link_libraries

Hendrik Sattler post at hendrik-sattler.de
Wed Nov 12 10:32:28 EST 2008


Bill Hoffman schrieb:
>> OTOH, it could make sense to do the following:
>>
>>  find_packge( CGAL REQUIRED <components> )
>>
>>  include( ${CGAL_USE_FILE} )
>>
>>  ....
>>  add_executable( program ... )
>>
>>  use_CGAL( program )
>>
>> so it works now with 2.4, and eventually "upgrade" it to use target
>> properties instead.
> 
> That sounds like a good way to go, and is similar to what the boost
> folks are doing.

But it is not backwards-compatible and will fail to link on the new
version while it worked fine on the old version.
Additionally, that would make ${CGAL_USE_FILE} obsolete as you can put
the macro into FindCGAL.cmake.

HS


More information about the CMake mailing list