[CMake] IF(TARGET var) fails on cmake 2.6.0
loose at astron.nl
Thu Jul 8 03:43:37 EDT 2010
On Wed, 2010-07-07 at 16:49 -0400, Brad King wrote:
> On 7/7/2010 7:45 AM, Marcel Loose wrote:
> > My pragmatic question is: is there a different way to check whether
> > target has already been defined, or not.
> Try this:
> get_target_property(mytarget_exists mytarget TYPE)
> The if(TARGET) mode was added in 2.6.2 to make the
> test more readable.
That works like a charm.
More information about the CMake