[CMake] How to tell if a project is an ExternalProject

David Cole david.cole at kitware.com
Wed Nov 7 06:57:18 EST 2012


On Wed, Nov 7, 2012 at 3:10 AM, Stefan Eilemann <eilemann at gmail.com> wrote:
>
> On 6. Nov 2012, at 23:43, "Marshall, Rob" <robm at qti.qualcomm.com> wrote:
>
>> I am trying to write a snippet that will determine if a library is an external project.
>
> We're using
>     get_target_property(_dep_check ${package} _EP_IS_EXTERNAL_PROJECT)
>     if(_dep_check EQUAL 1)
>         ...
>
> Not sure if this is a blessed way of doing so.
>


That is the way I would say you should do it...

Does that bless it? :-)

I would also say that you probably shouldn't need to do that. Projects
should be designed as "all ExternalProjects" (so-called Super Builds)
or as "no ExternalProjects" (the usual way using find_package).
Projects that mix the two are just asking for developer confusion down
the road. (My opinion, I realize others disagree with me...)


David


More information about the CMake mailing list