summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-13 19:35:10 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-13 19:35:10 (GMT)
commit9439cbd4baf0474b5dd05331cb7de31b48f045d1 (patch)
tree451d5e3a19dafd821b5fc0b9d6a45c1e7a0e288e /Modules/FindQt4.cmake
parentc327b569f07e1fb0f1421e9e72bb1f61a3547414 (diff)
downloadCMake-9439cbd4baf0474b5dd05331cb7de31b48f045d1.zip
CMake-9439cbd4baf0474b5dd05331cb7de31b48f045d1.tar.gz
CMake-9439cbd4baf0474b5dd05331cb7de31b48f045d1.tar.bz2
BUG: Fix FindQt4.cmake QT4_CREATE_MOC_COMMAND macro to work with spaces in the path while using the @ syntax on MSYS builds.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 627b708..5795b63 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -930,6 +930,16 @@ IF (QT4_QMAKE_FOUND)
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 @@ IF (QT4_QMAKE_FOUND)
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}