Am 22. Januar 2016 15:23:53 MEZ, schrieb Tom Kacvinsky 
<[email protected]>:
>I have need for a cross platform methods of getting libraries linked
>into an executable.
>
>Say for instance, we have
>
>add_library(foo STATIC a.c)
>add_exceutable(bar b.c)
>target_link_libraries(bar foo)
>
>So I know for that bar has a dependency on foo.lib (on Windows) and
>libfoo.a on Linux.
>
>And so forth.  What I would like to do is after everything is set up,
>query the properties of bar
>and find the list of libraries linked into bar in such a fashion I get
>that platform's specific library name (instead of the library's target
>name).

Is that the description of your problem or part of your idea of a solution?

If you need the real list after the executable is built, you can use
https://cmake.org/cmake/help/v3.4/module/GetPrerequisites.html

I use that to assemble a  build directory on windows where the executable can 
be debugged easily. Use it as part of a post build cmake script that of 
configured with the proper search paths.

>IS this possible?  I read the docs and didn't see a property for
>getting this list.  Did I miss something?  If so I plan on using
>either get_property of get_target_property.
>
>Thanks.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to