View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012554CMakeCMakepublic2011-11-02 16:402012-05-09 15:26
ReporterPierre-Francois Laquerre 
Assigned ToClinton Stimpson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platform64 bit linuxOSScientific LinuxOS Version6.1
Product Version 
Target VersionFixed in Version 
Summary0012554: Qt4 macros should quote arguments to shell commands
DescriptionThe macros in Modules/Qt4Macros.cmake do not properly quote their arguments when calling external commands through ADD_CUSTOM_COMMAND. This leads to issues when building projects with files whose name contains spaces or parentheses.

Adding VERBATIM to ADD_CUSTOM_COMMAND fixes this issue.
Steps To Reproduce1) Call any of the following macros when building a project in /tmp/foo(bar)/: QT4_CREATE_MOC_COMMAND (only on non-WIN32), QT4_WRAP_UI, QT4_ADD_RESOURCES, QT4_ADD_DBUS_INTERFACE, QT4_GENERATE_INTERFACE, QT4_ADD_DBUS_ADAPTOR, QT4_CREATE_TRANSLATION, QT4_ADD_TRANSLATION.

Expected behaviour: whatever these macros are supposed to do
Current behaviour: failure at the shell level, e.g.

> cd "/tmp/test(foo)/build.rel/qtlua/qlua" && /usr/lib64/qt4/bin/rcc -name qlua -o /tmp/test(foo)/build.rel/qtlua/qlua/qrc_qlua.cxx /tmp/test(foo)/qtlua/qlua/qlua.qrc
> /bin/sh: -c: line 0: syntax error near unexpected token `('
> /bin/sh: -c: line 0: `cd "/tmp/test(foo)/build.rel/qtlua/qlua" && /usr/lib64/qt4/bin/rcc -name qlua -o /tmp/test(foo)/build.rel/qtlua/qlua/qrc_qlua.cxx /tmp/test(foo)/qtlua/qlua/qlua.qrc'
> make[2]: *** [qtlua/qlua/qrc_qlua.cxx] Error 1
> make[2]: Leaving directory `/tmp/test(foo)/build.rel'
> make[1]: *** [qtlua/qlua/CMakeFiles/libqlua.dir/all] Error 2
> make[1]: Leaving directory `/tmp/test(foo)/build.rel'
> make: *** [all] Error 2

whereas the proper command should have been (notice the quotes):

> cd "/tmp/test(foo)/build.rel/qtlua/qlua" && /usr/lib64/qt4/bin/rcc -name "qlua" -o "/tmp/test(foo)/build.rel/qtlua/qlua/qrc_qlua.cxx" "/tmp/test(foo)/qtlua/qlua/qlua.qrc"
Additional InformationRelated mailing post: http://www.cmake.org/pipermail/cmake/2011-October/047101.html. [^] Adding VERBATIM to the ADD_CUSTOM_COMMAND calls fixes this. Patch included.
TagsNo tags attached.
Attached Filespatch file icon fix-qt4-macro-path-quoting.patch [^] (3,981 bytes) 2011-11-02 16:40 [Show Content]

 Relationships

  Notes
(0027903)
Clinton Stimpson (developer)
2011-12-03 19:55

In git repo:
9b07c19 Fix path quoting in Qt4 macros
Thanks for the patch.
(0029438)
David Cole (manager)
2012-05-09 15:26

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-11-02 16:40 Pierre-Francois Laquerre New Issue
2011-11-02 16:40 Pierre-Francois Laquerre File Added: fix-qt4-macro-path-quoting.patch
2011-11-18 02:32 Alex Neundorf Assigned To => Clinton Stimpson
2011-11-18 02:32 Alex Neundorf Status new => assigned
2011-12-03 19:55 Clinton Stimpson Note Added: 0027903
2011-12-03 19:55 Clinton Stimpson Status assigned => resolved
2011-12-03 19:55 Clinton Stimpson Resolution open => fixed
2012-05-09 15:26 David Cole Note Added: 0029438
2012-05-09 15:26 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team