Automoc with MSVC gets extra argument. Where is the bug?

Alexander Neundorf neundorf at kde.org
Wed Feb 3 21:39:22 CET 2010


Hi,

On Tuesday 02 February 2010, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> > On Sunday 31 January 2010, Stephen Kelly wrote:
> >> 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.
> >
> > Hmm, can you please explain ?
> > What command did you see, what did you execute manually ?
> > And what where the command line arguments you then got in
> > QCoreApplication::arguments ?
>
> Sorry. I wrote that email in a hurry on a linux machine and had intended to
> follow up with details when I got back on windows.
>
> After adding qDebug() << args; after both QCoreApplication::arguments()
> calls, here's the output while attempting to compile grantlee:
> (grantlee.org if you want to give it a shot. It finally builds! :) )
> As you can see, when cmake invokes automake, the path:
>
> C:/software/grantlee/build/grantlee_core_library/grantlee_core_library_auto
>moc.cpp
> is split into
>
> C:
>
> and
>
> /software/grantlee/build/grantlee_core_library/grantlee_core_library_automo
>c.cpp
>
> which is where I get breakage. So this looks like a cmake bug to me. When I
> invoke the same command myself, I can successfully run the command.
>
> C:\software\grantlee\build>cmake ..
> -- Building for: NMake Makefiles
> -- The C compiler identification is MSVC
> -- The CXX compiler identification is MSVC
> -- Check for CL compiler version
> -- Check for CL compiler version - 1500
> -- Check if this is a free VC compiler
> -- Check if this is a free VC compiler - no
> -- Check CL platform
> -- Check CL platform - 32 bit
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 9.0/VC/bin/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 9.0/VC/bin/cl.exe -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 9.0/VC/bin/cl.exe
> -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 9.0/VC/bin/cl.exe -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Looking for Q_WS_X11
> -- Looking for Q_WS_X11 - not found.
> -- Looking for Q_WS_WIN
> -- Looking for Q_WS_WIN - found
> -- Looking for Q_WS_QWS
> -- Looking for Q_WS_QWS - not found.
> -- Looking for Q_WS_MAC
> -- Looking for Q_WS_MAC - not found.
> -- Found Qt-Version 4.6.1 (using C:/Qt/4.6.1/bin/qmake.exe)
> -- Configuring done
> -- Generating done
> -- Build files have been written to: C:/software/grantlee/build

Ah, so you are using the independent from KDE, for a Qt-only project. That's 
nice :-) 
There are probably not that many projects out there which do this (mainly 
probably Phonon).
Can you please post your CMakeLists.txt which does the automoc-handling ?

> C:\software\grantlee\build>nmake VERBOSE=1
>
> Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
>         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:
> \software\grantlee
> -BC:\software\grantlee\build --check-build-system CMakeFiles\Makefile.cmake
> 0
>         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E
> cmake_progress_start
>  C:\software\grantlee\build\CMakeFiles C:
> \software\grantlee\build\CMakeFiles\pro
> gress.marks
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\BIN\nmake.exe" -f
>  CMakeFiles\Makefile2 /nologo -                   all
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\BIN\nmake.exe" -f
> grantlee_core_library\CMakeFiles\grantlee_core_library_automoc.dir\build.ma
>ke /nologo -L
> grantlee_core_library\CMakeFiles\grantlee_core_librar
> y_automoc.dir\depend
>         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_depends
> "NMake
>  Makefiles" C:\software\grantlee C:\software\grantlee\grantlee_core_library
> C:\s
> oftware\grantlee\build C:\software\grantlee\build\grantlee_core_library C:
> \softw
> are\grantlee\build\grantlee_core_library\CMakeFiles\grantlee_core_library_a
>utomo c.dir\DependInfo.cmake --color=
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\BIN\nmake.exe" -f
> 
> grantlee_core_library\CMakeFiles\grantlee_core_library_automoc.dir\build.ma
>ke /nologo -L
> grantlee_core_library\CMakeFiles\grantlee_core_librar
> y_automoc.dir\build
>         cd C:\software\grantlee\build\grantlee_core_library
>         "C:\Program Files (x86)\Automoc4\bin\automoc4.exe"
> C:/software/grantlee/build/grantlee_core_library/grantlee_core_library_auto
>moc.cpp C:/software/grantlee/grantlee_core_library
> C:/software/grantlee/build/grantlee_core_library C:/Qt/
> 4.6.1/bin/moc.exe "C:/Program Files (x86)/CMake 2.8/bin/cmake.exe"
> ("C:\Program Files (x86)\Automoc4\bin\automoc4.exe", "C:",
> "/software/grantlee/build/grantlee_core_library/grantlee_core_library_autom
>oc.cpp", "C:/software/grantlee/grantlee_core_library",
> "C:/software/grantlee/build/grantlee_core_library",
>  "C:/Qt/4.6.1/bin/moc.exe", "C:/Program Files
> (x86)/CMake2.8/bin/cmake.exe") 


Ok, I see the issue. Strange that the "C:" is split away from the cpp file, 
but not from the directories ("grantlee_core_library").
So you do this with NMake makefiles in a normal cmd.exe, no mingw or something 
like this, right ?

Windows developers, Patrick: have you seen this issue before somewhere ?

> Error: syntax error in C:.files 
> NMAKE : fatal error U1077: '"C:\Program Files
> (x86)\Automoc4\bin\automoc4.exe"'
>
> : return code '0x1'
>
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\
> VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\
> VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
>
>
> #### Manually running it:
>
> C:\software\grantlee\build>"C:\Program Files
> (x86)\Automoc4\bin\automoc4.exe"
> C:/software/grantlee/build/grantlee_core_library/grantlee_core_library_auto
>moc.cpp C:/software/grantlee/grantlee_core_library
> C:/software/grantlee/build/grantlee_core_library C:/Qt/4.6.1/bin/moc.exe
> "C:/Program Files (x86)/CMake 2.8/bin/cmake.exe"
> ("C:\Program Files (x86)\Automoc4\bin\automoc4.exe",
> "C:/software/grantlee/build
> /grantlee_core_library/grantlee_core_library_automoc.cpp",
> "C:/software/grantlee
> /grantlee_core_library",
> "C:/software/grantlee/build/grantlee_core_library", "C:
> /Qt/4.6.1/bin/moc.exe", "C:/Program Files (x86)/CMake 2.8/bin/cmake.exe")
> ("C:\Program Files (x86)\Automoc4\bin\automoc4.exe",
> "C:/software/grantlee/build
> /grantlee_core_library/grantlee_core_library_automoc.cpp",
> "C:/software/grantlee
> /grantlee_core_library",
> "C:/software/grantlee/build/grantlee_core_library", "C:
> /Qt/4.6.1/bin/moc.exe", "C:/Program Files (x86)/CMake 2.8/bin/cmake.exe")
> Generating moc_parser.cpp
> Generating moc_node.cpp
> Generating moc_mutabletemplate.cpp
> Generating moc_template.cpp
>
> C:\software\grantlee\build>

Alex


More information about the Kde-windows mailing list