Automoc with MSVC gets extra argument. Where is the bug?
Stephen Kelly
steveire at gmail.com
Sun Jan 31 11:26:49 CET 2010
Hi,
While trying to get Grantlee working with MSVC I hit a bug in Automoc4.
QCoreApplication::arguments always contained the drive letter ("C:") in the
second position when run by cmake, but not when I invoked the same command
myself. I think I used cmake --debug-mode or nmake VERBOSE=1 to get the
command it was executing.
My local hack was something like this:
diff --git a/automoc/kde4automoc.cpp b/automoc/kde4automoc.cpp
index e85ec62..6c52901 100644
--- a/automoc/kde4automoc.cpp
+++ b/automoc/kde4automoc.cpp
@@ -163,7 +163,8 @@ void AutoMoc::lazyInitMocDefinitions()
void AutoMoc::lazyInit()
{
- const QStringList &args = QCoreApplication::arguments();
+ QStringList args = QCoreApplication::arguments();
+ args.takeAt(1);
mocExe = args[4];
cmakeExecutable = args[5];
@@ -224,7 +225,8 @@ void AutoMoc::lazyInit()
bool AutoMoc::run()
{
- const QStringList &args = QCoreApplication::arguments();
+ QStringList args = QCoreApplication::arguments();
+ args.takeAt(1);
Q_ASSERT(args.size() > 0);
if (args.size() == 2) {
if ((args[1]=="--help") || (args[1]=="-h")) {
Obviously it's not a correct or portable solution.
I'm trying to find out whether this is a bug in
* automoc ("On windows the second arg might be the drive letter, depending
on how the app was invoked and you need to handle that")
* cmake (A string split operation going wrong somewhere)
* windows (A string split operation going wrong somewhere)
Any ideas?
Steve.
More information about the Kde-buildsystem
mailing list