[CMake] Alias of imported target

Stephen Kelly steveire at gmail.com
Thu May 14 13:16:42 EDT 2015


CHEVRIER, Marc wrote:

> 
> My need is the following:
> I have two imported targets, let say, IMPORTED::TARGET and
> IMPORTED::STATIC::TARGET
> 
> 
> And I have a project which can be customised, through an option, by
> selecting which imported target will be used (shared or static).
> 
> So I tried, at first place:
> if (USE_IMPORTED_STATIC)
>   add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::STATIC::TARGET)
> else()
>   add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::TARGET)
> endif()
> 
> So, after, I do not longer take care of which imported target is selected!

This makes sense to me, thanks.

I filed 

 http://public.kitware.com/Bug/view.php?id=15569

to track it.

Thanks,

Steve.




More information about the CMake mailing list