[cmake-commits] king committed FindQt4.cmake 1.92 1.93

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Feb 13 14:35:13 EST 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv27289/Modules

Modified Files:
	FindQt4.cmake 
Log Message:
BUG: Fix FindQt4.cmake QT4_CREATE_MOC_COMMAND macro to work with spaces in the path while using the @ syntax on MSYS builds.


Index: FindQt4.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindQt4.cmake,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- FindQt4.cmake	8 Feb 2008 17:01:54 -0000	1.92
+++ FindQt4.cmake	13 Feb 2008 19:35:10 -0000	1.93
@@ -930,6 +930,16 @@
   MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_includes moc_options)
     # For Windows, create a parameters file to work around command line length limit
     IF (WIN32)
+      # Pass the parameters in a file.  Set the working directory to
+      # be that containing the parameters file and reference it by
+      # just the file name.  This is necessary because the moc tool on
+      # MinGW builds does not seem to handle spaces in the path to the
+      # file given with the @ syntax.
+      GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
+      GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
+      IF(_moc_outfile_dir)
+        SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+      ENDIF(_moc_outfile_dir)
       SET (_moc_parameters_file ${outfile}_parameters)
       SET (_moc_parameters ${moc_includes} ${moc_options} -o "${outfile}" "${infile}")
       FILE (REMOVE ${_moc_parameters_file})
@@ -937,8 +947,9 @@
         FILE (APPEND ${_moc_parameters_file} "${arg}\n")
       ENDFOREACH(arg)
       ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-                         COMMAND ${QT_MOC_EXECUTABLE} @${_moc_parameters_file}
+                         COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
                          DEPENDS ${infile}
+                         ${_moc_working_dir}
                          VERBATIM)
     ELSE (WIN32)     
       ADD_CUSTOM_COMMAND(OUTPUT ${outfile}



More information about the Cmake-commits mailing list