[cmake-developers] Generating guards around add_library(... IMPORTED)

Stephen Kelly steveire at gmail.com
Thu Nov 29 14:12:39 EST 2012


Brad King wrote:

> On 11/29/2012 01:44 PM, Stephen Kelly wrote:
>> 1) and 2) imply for me that we can wrap the entire snippet I pasted above
>> in if (NOT TARGET grantlee_core).
> 
> Okay with me.  You could also do
> 
>  if(NOT TARGET a AND NOT TARGET b AND ...)
> 
> for all of the targets.  Then there would be almost no chance confusion
> from accidental collision of one target name.
> 

Rather than reindenting everything, can I do this instead?

 if(TARGET a OR TARGET b OR ...)
   return()
 endif()

Thanks,

Steve.





More information about the cmake-developers mailing list