Re: [CMake] IF(TARGET var) fails on cmake 2.6.0

2010-07-08 Thread Marcel Loose
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 a > > target has already been defined, or not. > > Try this: > >get_target_property(mytarget_exists mytarget TYPE) >if(myt

Re: [CMake] IF(TARGET var) fails on cmake 2.6.0

2010-07-07 Thread Brad King
On 7/7/2010 7:45 AM, Marcel Loose wrote: My pragmatic question is: is there a different way to check whether a target has already been defined, or not. Try this: get_target_property(mytarget_exists mytarget TYPE) if(mytarget_exists) message("YES") else() message("NO") endif()

[CMake] IF(TARGET var) fails on cmake 2.6.0

2010-07-07 Thread Marcel Loose
Hi all, Today I stumbled upon the following problem. On a somewhat older machine we have cmake 2.6-patch 0 installed. Up till now I had done my development on a machine running cmake 2.6-patch 2, and everything was working fine, also with newer versions of cmake (2.6-patch 4, 2.8.1, etc). With c