Ok, just had a quick look at the qmake sources.
It expects the user to provide the make spec either as a qmake option( -spec or -platform ) or in the QMAKESPEC environment variable. If it cannot find it this way, it takes the default, which is located in QTDIR/mkspecs/default. The problem is that in the opensource version this folder does not exist. In the version precompiled for mingw it exists and it is the same as win32-g++ and for the commercial versions is set according to the msvc version of the distribution.
If it cannot find it in the default directory error it displays an error message:
if(cmd & ReadConf) { // parse mkspec
QString qmakespec
= fixEnvVariables
(Option
::mkfile::qmakespec);
debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(),
mkspec_roots.join("::").toLatin1().constData());
if(qmakespec.isEmpty()) {
for(QStringList::ConstIterator it
= mkspec_roots.
begin(); it
!= mkspec_roots.
end();
++it
) { QString mkspec
= (*it
) + QDir::separator() + "default";
if(default_info.exists() && default_info.isDir()) {
qmakespec = mkspec;
break;
}
}
if(qmakespec.isEmpty()) {
fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n");
return false;
}
Option::mkfile::qmakespec = qmakespec;
}
if(cmd & ReadConf) { // parse mkspec
QString qmakespec = fixEnvVariables(Option::mkfile::qmakespec);
QStringList mkspec_roots = qmake_mkspec_paths();
debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(),
mkspec_roots.join("::").toLatin1().constData());
if(qmakespec.isEmpty()) {
for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) {
QString mkspec = (*it) + QDir::separator() + "default";
QFileInfo default_info(mkspec);
if(default_info.exists() && default_info.isDir()) {
qmakespec = mkspec;
break;
}
}
if(qmakespec.isEmpty()) {
fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n");
return false;
}
Option::mkfile::qmakespec = qmakespec;
}
To copy to clipboard, switch view to plain text mode
So I think it is ok and enough to provide a dropdown or a list with all the makespecs available on windows and let the user choose from them
...and also there is a problem with switches changes between different versions
No problem whatsoever. VS also has the option to switch between different Qt installations, but it does it internally.
It is just a matter of setting the environment variables to the desired installation.
Bookmarks