[CMake] targetname_BINARY_DIR?

David Cole david.cole at kitware.com
Tue Jan 18 06:42:54 EST 2011


There is nothing like that... Unless the target has had its directory
property *set* before you make the get_property call.

Why do you need this? What's your use case where the name of a target is
known, but the name of its containing project is unknown (presumably)...?


On Mon, Jan 17, 2011 at 9:47 PM, Pau Garcia i Quiles
<pgquiles at elpauer.org>wrote:

> Hello,
>
> If I use:
>
> project( blah )
>
> that creates variables blah_SOURCE_DIR and blah_BINARY_DIR.
>
> Does anything like that exist for a *target* ? I've managed to emulate
> targetname_SOURCE_DIR with:
>
>  get_target_property(${name}_SOURCEFILES ${name} SOURCES)
>  list(GET ${name}_SOURCEFILES 0 ${name}_FIRST_SOURCEFILE )
>  get_source_file_property(${name}_SUBDIR_FULLPATH
> ${${name}_FIRST_SOURCEFILE} LOCATION)
>  string(REPLACE ${WT_SOURCE_DIR}/examples/ "" ${name}_SUBDIRANDSOURCE
> ${${name}_SUBDIR_FULLPATH})
>  string(REPLACE /${${name}_FIRST_SOURCEFILE} "" ${name}_SUBDIR
> ${${name}_SUBDIRANDSOURCE})
>
> However, I don't know how to emulate targetname_BINARY_DIR. I tried with:
>
>  get_target_property(${name}_RUNTIME_OUTPUT_DIRECTORY ${name}
> RUNTIME_OUTPUT_DIRECTORY)
>
> But I get NOTFOUND :-(
>
> Thank you
>
> --
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to my workload, I may need 10 days to answer)
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110118/6d9410cc/attachment.htm>


More information about the CMake mailing list