Qt-interest Archive, April 2008
Matching between MSV vcproj settings and qmake .pro file.
Message 1 in thread
Dear Qt community,
I am currently working with Qt 4.3.3 under MS Visual Studio 2003
(MSV). My problem is how to get the settings I made in MSV into the
my qmake .pro file so when I add files and rerun qmake to generate
the right .vcproj file, they are not lost so that I have to reset
them manually in MSV again.
The problem is: how is the matching from the settings in the vcproj
file to the corresponding parameters in the .pro file? Does anyone
know whether there's a web site or a book about Qt where this is
covered?
The settings I use include:
"Project" -> Properties... -> Linker -> Command Line -> Additional
Options -> /NODEFAULTLIB:msvcprtd
"Project" -> Properties... -> Debugging -> Action -> Command
(different between debug and release version)
"Project" -> Properties... -> Linker -> Debugging -> "Generate Debug Info" -> "Yes"
etc.
Would be great if anyone of you could point me to some hints.
Kind regards,
Peter.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Message 2 in thread
Hi Peter,
you can actually put many platform- compiler- and configuration(debug,
release) specific settings into a .pro file. Qmake knows how to put them
into the right place (especially for MSVC).
Peter wrote:
> "Project" -> Properties... -> Linker -> Command Line -> Additional
> Options -> /NODEFAULTLIB:msvcprtd
This is the snippet I usually use for linker parameters:
CONFIG(debug, debug|release) {
QMAKE_LFLAGS += /NODEFAULTLIB:msvcprtd
}
CONFIG(release, debug|release) {
QMAKE_LFLAGS += /NODEFAULTLIB:msvcprt
}
...notice how it sets different values for debug and release
> "Project" -> Properties... -> Debugging -> Action -> Command
> (different between debug and release version)
Bad news: This information is stored neither in the .sln nor in the
.vcproj file, so you cannot set it via .pro file.
Good news: Once you set it in the IDE, it should not get overridden by a
new call of qmake, since qmake only writes .vcproj and sometimes .sln files.
> "Project" -> Properties... -> Linker -> Debugging -> "Generate Debug
> Info" -> "Yes"
This one should by default be generated by qmake as expected, or isn't
it in your case?
> Would be great if anyone of you could point me to some hints.
http://doc.trolltech.com/4.3/qmake-manual.html
Good luck,
Alessandro
--
[ signature omitted ]
Message 3 in thread
Hello Alessandro,
thank you for your help, especially the CONFIG() and the LFLAGS one.
I already used LFLAGS some time ago, but didn't know that it could
be used this way to introduce the /NODEFAULTLIB into the linker
command line. - Many thanks for that very useful hint.
So then I will follow your proposal and use the qmake manual when
digging deeper into it.
Once again many thanks for your help and till soon,
Best regards,
Peter.
P.S.:
It's of course unfortunate that the settings aren't stored in one de-
dicated place in MSVC - that is one of the drawbacks in some of Micro-
softs software (especially the Windows OS).
But this way there's the one benefit that those settings which are
not saved into the vcproj file aren't overwritten when generating a
new version of it (as you already remarked).
The problems arise when trying to copy the project to fellows working
on the same project for providing them with the same settings.
I saw that the
> "Project" -> Properties... -> Debugging -> Action -> Command
is stored in the .suo file which however is binary and not raw text
like the .vjproj file. So it would be more difficult to generate
the .suo file, too, since I don't know how its syntax is and whether
it is available somewhere. At msdn I read that it can be written
using the Visual Studio SDK. But then I am not sure when ones would
(hypothetically) try to add this feature to qmake whether it would
become too big and/or dependent on the libraries of the VS SDK what
of course we don't want.
Alessandro Portale <Alessandro.Portale@xxxxxxxxxxxxx> wrote: Hi Peter,
you can actually put many platform- compiler- and configuration(debug,
release) specific settings into a .pro file. Qmake knows how to put them
into the right place (especially for MSVC).
Peter wrote:
> "Project" -> Properties... -> Linker -> Command Line -> Additional
> Options -> /NODEFAULTLIB:msvcprtd
This is the snippet I usually use for linker parameters:
CONFIG(debug, debug|release) {
QMAKE_LFLAGS += /NODEFAULTLIB:msvcprtd
}
CONFIG(release, debug|release) {
QMAKE_LFLAGS += /NODEFAULTLIB:msvcprt
}
...notice how it sets different values for debug and release
> "Project" -> Properties... -> Debugging -> Action -> Command
> (different between debug and release version)
Bad news: This information is stored neither in the .sln nor in the
.vcproj file, so you cannot set it via .pro file.
Good news: Once you set it in the IDE, it should not get overridden by a
new call of qmake, since qmake only writes .vcproj and sometimes .sln files.
> "Project" -> Properties... -> Linker -> Debugging -> "Generate Debug
> Info" -> "Yes"
This one should by default be generated by qmake as expected, or isn't
it in your case?
> Would be great if anyone of you could point me to some hints.
http://doc.trolltech.com/4.3/qmake-manual.html
Good luck,
Alessandro
--
[ signature omitted ]