[cmake-developers] Listing source-tree files encountered

Florent Castelli florent.castelli at gmail.com
Sat Jul 18 05:30:39 EDT 2015


I've used that once and you end up with the relative path to the sources 
from the CMakeLists.txt.
If you're in another CMakeLists.txt, then you can't use the paths 
directly. I tried a few properties but I couldn't find any property to 
get the folder where the target was defined.

How do you get the full path?

/Orphis

On 17/07/2015 17:50, Brad King wrote:
> On 07/15/2015 10:38 PM, Clifford Yapp wrote:
>> Lists that contains a verbatim collection of all path specifiers,
>> regardless of form, that are passed to the various add_* targets would
>> be enough, I think - it'd then be up to our own CMake logic to make
>> sense of it all.  I'm not hoping to push our whole
>> in-src-dir/distcheck system into mainstream CMake, just looking for a
>> way to achieve the current result without requiring the
>> built-in-command overrides - I think collecting raw lists of paths
>> supplied to targets is the key piece that is currently driving the
>> command overrides.
> Once the list of all targets is available in a global property as
> discussed in another branch of this thread, then you could loop
> over that and check the SOURCES target property to get the list
> of original path specifiers.  That would handle almost everything.
> What would be left for your use case?
>
> -Brad
>



More information about the cmake-developers mailing list