Re: [cmake-developers] Recommended usage of OBJECT_DEPENDS

2012-06-15 Thread Brad King
On 06/14/2012 05:04 PM, Alexander Neundorf wrote:
 In KDEs FindQt4.cmake the macro
 
 qt4_generate_moc(inCppFile outMocFile)
 
 uses the OBJECT_DEPENDS property to enforce that the moc file
 is generated before the cpp file is built.

The original purpose of OBJECT_DEPENDS was to solve a problem
with generated headers *way* back in the original makefile
generator.  Since the modern generator ensures all custom
commands have been evaluated to generate things before CMake
scan dependencies its original purpose is no longer necessary.

However, it is still useful to bring a custom command into
a target without explicitly naming the custom command output
as a target source.  If the output of a custom command is the
OBJECT_DEPENDS of some compiled source file that is in the
target then both will be brought in.  I think that may be the
case for moc but I'm not sure of the top of my head.

-Brad
--

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] Recommended usage of OBJECT_DEPENDS

2012-06-14 Thread Alexander Neundorf
Hi,

we hit an issue in KDE related to the usage (or not-usage) of the 
OBJECT_DEPENDS source file property.

In KDEs FindQt4.cmake the macro 
qt4_generate_moc(inCppFile outMocFile)
uses the OBJECT_DEPENDS property to enforce that the moc file is generated 
before the cpp file is built.
This seems to work reliably, at least I haven't heard of any problems with 
this since years.

Now the same macro in cmake does not set the OBJECT_DEPENDS property.

Should it ?
Is enforcing such a dependency a valid use case for OBJECT_DEPENDS ?


Alex
--

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