[cmake-developers] set_property(DIRECTORY) regression ?

Stephen Kelly steveire at gmail.com
Wed May 16 06:25:59 EDT 2012


Brad King wrote:

> On 5/14/2012 5:18 PM, Alexander Neundorf wrote:
>> This is the output I get when running the attachec example with cmake
>> 2.6.4 and 2.8.0:
> 
> The behavior of properties did not change.  There was a
> bug in CMake 2.6 that was fixed here:
> 
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21fc04ef
> 
> The patch below works around this bug in 2.6 and shows
> that the behavior is the same for 2.6 and 2.8 in terms
> of the property inheritance.
> 
> Directory properties are not inherited by default.  The
> define_property() command may be used to change that for
> user-defined properties by using the INHERITED option:
> 
>  http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:define_property
> 
> I've never used that in a real project though.

Thanks for the feedback on this and the suggestion. Actually that 
define_property was also in Michaels suggestion[1], but when it required me 
to specify FULL_DOCS and BRIEF_DOCS arguments, I thought it didn't seem 
suitable for something which is internal and autogenerated (And I didn't 
know what effect it would have :) ).

[1] 
http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/7165/focus=41551

Given that the variable or directory property guards are more complex to 
maintain, and given that the point of their existance is to guard against 
accidental naming clash between the imported targets and targets created as 
part of a buildsystem, and given that Qt5::Foo is already unusual enough 
that name clashes are unlikely, I just changed it to use IF(NOT TARGET) 
instead [2].

[2] https://codereview.qt-project.org/#change,26253

Thanks,

Steve.





More information about the cmake-developers mailing list