[Qt-interest] qmake Visual Studio project generation target name
Jiawen Chen
jiawen at gmail.com
Fri Dec 18 05:33:20 CET 2009
Hi,
I have a few questions regarding qmake's visual studio project
generation ability.
0. Is there an easy way to generate a visual studio project that has a
64-bit configuration? It doesn't look too difficult to add since the
settings (nodes in the xml .vcproj file) are almost identical. Maybe
just add a x64 switch to qmake or put it inside the .pro file. Right
now, every time I re-generate the .vcproj, I have to open it in visual
studio and add a new solution configuration. Worse, if the .sln already
exists, and the .vcproj is re-generated, visual studio freaks out and
doesn't build the x64 version of the project. I have to delete the x64
configuration and recreate it. One hack I found on the web at
http://www.xuvtools.org/doku.php?id=devel:compile-win is:
PROJECTFILES=$(find . -name \*cproj -o -name \*sln)
perl -pi -e 's/Name="Win32"/Name="x64"/g;s/\|Win32/\|x64/g' ${PROJECTFILES}
1. I'm using the Intel C++ compiler on Windows and compiled Qt using the
win32-icc QMAKESPEC, which works great. qmake doesn't seem to like
QMAKESPEC=win32-icc, when I do "qmake -t vcapp foo.pro" or "qmake -t
vclib foo.pro", it creates "foo.dsp", which appears to be a Visual
Studio 6.0 (!) project. Any suggestions on how to handle this?
Ideally, since the Intel C++ compiler comes with a Visual Studio plugin,
which creates a .icproj file from a .vcproj file and lets the user
switch between using Microsoft vs Intel C++ compilers, qmake should be
able to generate both the .vcproj file and a .icproj file. I guess
that's a pipe dream.
2. Finally, a rather silly last question. I'm building a static
library, which due to multiple C library syndrome, needs to have two
different target names. I would like the debug version to be called
"libcgtd.lib" and the release version to be called "libcgt.lib". I have
libcgt.pro set up as:
TEMPLATE = lib
CONFIG += qt thread debug_and_release staticlib
CONFIG( debug, debug|release ) {
TARGET = libcgtd
} else {
TARGET = libcgt
}
...
In makefile mode, it works fine. Unfortunately, when I generate
projects with "qmake -t vclib", it generates libcgtd.vcproj. If I try
to force it with "qmake -t vclib -o libcgt.vcproj", when I open it in
Visual Studio, the project name is still "libcgtd". In the XML file,
under <VisualStudioProject> the Name attribute is still "libcgtd". Is
there a way to force it to grab the default name?
Cheers,
Jiawen
More information about the Qt-interest-old
mailing list