[Cmake-commits] CMake branch, next, updated. v2.8.8-2943-g7e33b05
Brad King
brad.king at kitware.com
Tue May 29 13:08:43 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 7e33b05f1407d134237a74affb8cf9f4593e4e91 (commit)
via 9ce67d30011db4528d3d0bbee36412e13cfb80cc (commit)
from 0d3ebe5498e274bdacf67e1b8638327774cdfc28 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e33b05f1407d134237a74affb8cf9f4593e4e91
commit 7e33b05f1407d134237a74affb8cf9f4593e4e91
Merge: 0d3ebe5 9ce67d3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue May 29 13:08:41 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 29 13:08:41 2012 -0400
Merge topic 'Qt4Macros-generated-resources' into next
9ce67d3 Qt4Macros: Added support for generated resource files
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ce67d30011db4528d3d0bbee36412e13cfb80cc
commit 9ce67d30011db4528d3d0bbee36412e13cfb80cc
Author: Tobias Bieniek <Tobias.Bieniek at gmx.de>
AuthorDate: Tue May 29 17:45:03 2012 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue May 29 13:07:40 2012 -0400
Qt4Macros: Added support for generated resource files
Using the QT4_ADD_RESOURCES() macro required the resource file to exist
already for dependency scanning. This prevented the use of resource
files that are generated by cmake because it needs the file before
resolving the dependency. This patch adds support for generated
resource files by not scanning the resource file for dependencies if it
doesn't exist yet. The add_custom_command() to generate the resource
file should add the dependencies on the files used by the resource file.
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index f327125..f867bc5 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -182,23 +182,31 @@ MACRO (QT4_ADD_RESOURCES outfiles )
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
- # parse file for dependencies
- # all files are absolute paths or relative to the location of the qrc file
- FILE(READ "${infile}" _RC_FILE_CONTENTS)
- STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+
SET(_RC_DEPENDS)
- FOREACH(_RC_FILE ${_RC_FILES})
- STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
- IF(NOT IS_ABSOLUTE "${_RC_FILE}")
- SET(_RC_FILE "${rc_path}/${_RC_FILE}")
- ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
- SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
- ENDFOREACH(_RC_FILE)
- # Since this cmake macro is doing the dependency scanning for these files,
- # let's make a configured file and add it as a dependency so cmake is run
- # again when dependencies need to be recomputed.
- QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
- CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY)
+ IF(EXISTS "${infile}")
+ # parse file for dependencies
+ # all files are absolute paths or relative to the location of the qrc file
+ FILE(READ "${infile}" _RC_FILE_CONTENTS)
+ STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+ FOREACH(_RC_FILE ${_RC_FILES})
+ STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
+ IF(NOT IS_ABSOLUTE "${_RC_FILE}")
+ SET(_RC_FILE "${rc_path}/${_RC_FILE}")
+ ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
+ SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
+ ENDFOREACH(_RC_FILE)
+ # Since this cmake macro is doing the dependency scanning for these files,
+ # let's make a configured file and add it as a dependency so cmake is run
+ # again when dependencies need to be recomputed.
+ QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
+ CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY)
+ ELSE(EXISTS "${infile}")
+ # The .qrc file does not exist (yet). Let's add a dependency and hope
+ # that it will be generated later
+ SET(out_depends)
+ ENDIF(EXISTS "${infile}")
+
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
-----------------------------------------------------------------------
Summary of changes:
Modules/Qt4Macros.cmake | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list