[CMake] List all binaries associated with a target.

Klaim - Joël Lamotte mjklaim at gmail.com
Tue Mar 24 20:00:44 EDT 2015


On Sun, Mar 22, 2015 at 12:49 PM, Roman Bolshakov <roolebo at gmail.com> wrote:

> Unfortunately, if my understanding is correct,
>> this code cannot work with external dependencies as they are not targets.
>
>
> It should work with external dependencies which are imported targets. You
> just need to check IMPORTED property is True and then you can extract
> precise location from IMPORTED_LOCATION property. It will also work for
> full paths which are used in target_link_libraries, you will need to check
> that the file exists and then add it into DEPENDENCY_LIST property.
>

Sorry but I don't understand what you mean, I think I'm confused maybe
because I don't understand some details.
My understanding is that IMPORTED is usable as an option when you defined a
target, so that you can use it later as a dependency or command,
manually setting it's prorties yourself.
Now, in my case I have dependencies that I get using the find_package()
function, some modules being provided by CMake, others not.
When using find_package(), no target is created. So how should I check the
IMPORTED property of dependencies tracked this way?
Could you give me an example to clarify?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150325/9605f1cc/attachment.html>


More information about the CMake mailing list