|
From: <ai...@us...> - 2009-09-30 18:26:08
|
Revision: 10497
http://plplot.svn.sourceforge.net/plplot/?rev=10497&view=rev
Author: airwin
Date: 2009-09-30 18:26:00 +0000 (Wed, 30 Sep 2009)
Log Message:
-----------
Configure moc_files.h rather than writing it. This eliminates unnecessary
rebuilds of all qt-related software each time any CMakeLists.txt file is
touched.
Improve comments on what qt4_wrap_cpp actually does (which is to create
a custom command whose OUTPUT should be depended on by a custom target in
order to be executed at make time).
Modified Paths:
--------------
trunk/include/CMakeLists.txt
Added Paths:
-----------
trunk/include/moc_files.h.in
Modified: trunk/include/CMakeLists.txt
===================================================================
--- trunk/include/CMakeLists.txt 2009-09-30 17:11:53 UTC (rev 10496)
+++ trunk/include/CMakeLists.txt 2009-09-30 18:26:00 UTC (rev 10497)
@@ -120,18 +120,27 @@
list(APPEND MOC_OPTIONS -DPLD_extqt)
endif(PLD_extqt)
if(MOC_OPTIONS)
+ # This creates a custom command with OUTPUT ${QT_MOC_OUTFILES}.
qt4_wrap_cpp(
QT_MOC_OUTFILES
${CMAKE_SOURCE_DIR}/include/qt.h
OPTIONS ${MOC_OPTIONS}
)
- # Use custom target to force correct dependencies in various directories.
- # This target is used in three possible places (qt_gui, drivers, or src)
- # depending on build options.
+ # Use custom target to force correct target dependencies in
+ # various directories. This target is used in three possible
+ # places (qt_gui, drivers, or src) depending on build options.
+ # The CMake dependency parser creates the necessary file
+ # dependency on qt.h for all qt-related source code so there is no
+ # need to add the ${QT_MOC_OUTFILES} file dependencies for any
+ # target dependency on moc_outfiles_generated.
add_custom_target(moc_outfile_generated DEPENDS ${QT_MOC_OUTFILES})
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/moc_files.h "/* Generated header file listing the moc generated files to include in plqt.cpp. */ \n#ifndef __MOC_FILES_H__\n#define __MOC_FILES_H__\n\n")
- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/moc_files.h "#include \"${QT_MOC_OUTFILES}\"\n")
- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/moc_files.h "#endif /* __MOC_FILES_H__i */ \n")
+
+ # #include ${QT_MOC_OUTFILES}) indirectly via the configured moc_files.h
+ # header.
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/moc_files.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/moc_files.h
+ )
else(MOC_OPTIONS)
message(FATAL_ERROR "Internal build system inconsistency between ANY_QT_DEVICE true and MOC_OPTIONS false.")
endif(MOC_OPTIONS)
Added: trunk/include/moc_files.h.in
===================================================================
--- trunk/include/moc_files.h.in (rev 0)
+++ trunk/include/moc_files.h.in 2009-09-30 18:26:00 UTC (rev 10497)
@@ -0,0 +1,6 @@
+/* Configured header file listing the moc-generated files to include in plqt.cpp. */
+#ifndef __MOC_FILES_H__
+#define __MOC_FILES_H__
+
+#include "@QT_MOC_OUTFILES@"
+#endif /* __MOC_FILES_H__i */
Property changes on: trunk/include/moc_files.h.in
___________________________________________________________________
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|