Re: [cmake-developers] set_property(DIRECTORY) regression ?

2012-05-16 Thread Stephen Kelly
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.


--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] set_property(DIRECTORY) regression ?

2012-05-15 Thread Brad King
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.

-Brad


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fbf3a4..7c465c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ if (NOT _qt5CoreTargetExists)
 set_property(DIRECTORY PROPERTY _Qt5Core_target TRUE)
 message(STATUS DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED 
IMPORTED))
 endif()
+set(_qt5CoreTargetExists )

 get_property(_qt5CoreTargetExists DIRECTORY PROPERTY _Qt5Core_target)
 message(STATUS ex 2: ${_qt5CoreTargetExists})
@@ -13,5 +14,6 @@ if (NOT _qt5CoreTargetExists)
 set_property(DIRECTORY PROPERTY _Qt5Core_target TRUE)
 message(STATUS DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED 
IMPORTED))
 endif()
+set(_qt5CoreTargetExists )

 add_subdirectory(sub)
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] set_property(DIRECTORY) regression ?

2012-05-14 Thread Alexander Neundorf
Hi,

it seems the behaviour of DIRECTORY properties changed from cmake 2.6.4 to 
2.8.0.
It seems when setting a directory property, with 2.6.4 this was inherited into 
subdirs, with 2.8.0 and above not anymore.

This is the output I get when running the attachec example with cmake 2.6.4 
and 2.8.0:
Please note how with 2.6.4 ex is TRUE in the subdir sub/, while with 2.8.0 
it is not set in sub/ :

hammer:~/src/CMake/tests/dirprop/build$ /opt/cmake-2.6.4-Linux-i386/bin/cmake 
..
-- ex 1: 
-- DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED IMPORTED)
-- ex 2: TRUE
-- ex sub: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/src/CMake/tests/dirprop/build


hammer:~/src/CMake/tests/dirprop/build$ /opt/cmake-2.8.0-Linux-i386/bin/cmake 
..
-- ex 1: 
-- DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED IMPORTED)
-- ex 2: TRUE
-- ex sub: 
-- DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED IMPORTED)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/src/CMake/tests/dirprop/build


Alex


dirprops.tar.gz
Description: application/compressed-tar
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers