[cmake-developers] target sources property

Stephen Kelly steveire at gmail.com
Wed Jul 10 11:12:17 EDT 2013


Brad King wrote:
> IIRC we have the same problem with inter-target dependencies and
> we solved it by taking the union of dependencies from all configs.
> Is that right? 

Yes, I think that's right.

> I don't think that solution can work for source files.
> Perhaps for Xcode we can generate wrapper sources that conditionally
> #include the real source based on the configuration.  Hopefully there
> is a better way.

That doesn't sound very attractive indeed.

> BTW, the hunk
> 
> -    this->SetProperty("SOURCES", ss.str().c_str());
> +    this->SetProperty("SOURCES_INTERNAL", ss.str().c_str());
> +    return this->GetProperty("SOURCES_INTERNAL");
> 
> does not need to set an internal property.  We can just return the
> string.  The only reason the old code set the property was to fall
> through to the normal property lookup later in the method.
> 

Yes, but I guess it's also memory management. I can't return str.c_str() if 
str is an automatic variable. I guess I can use the trick of creating a 
static std::string and return that.

Thanks,

Steve.





More information about the cmake-developers mailing list