Generate a .qmake.cache in config.tests from configure.exe.

We need to generate a .qmake.cache file in the config.tests
directory on Windows to ensure that the config.tests can
actually be compiled before the qmodule.pri is created.

Task-number: QTBUG-27708
Change-Id: I8d9397a8cbdb2aa19a5318497177d76049f9fa91
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Jason Barron 2012-10-29 10:17:33 +01:00 committed by The Qt Project
parent a48508cd76
commit 57fed47ac0
3 changed files with 24 additions and 0 deletions

View File

@ -2312,6 +2312,25 @@ void Configure::generateBuildKey()
build_defines.sort();
}
void Configure::generateSystemVars()
{
// Generate an empty .qmake.cache file for config.tests
QDir buildDir(buildPath);
bool success = true;
if (!buildDir.exists("config.tests"))
success = buildDir.mkdir("config.tests");
QString fileName(buildPath + "/config.tests/.qmake.cache");
QFile cacheFile(fileName);
success &= cacheFile.open(QIODevice::WriteOnly);
cacheFile.close();
if (!success) {
cout << "Failed to create file " << qPrintable(QDir::toNativeSeparators(fileName)) << endl;
dictionary[ "DONE" ] = "error";
}
}
void Configure::generateOutputVars()
{
// Generate variables for output

View File

@ -83,6 +83,7 @@ public:
void generateConfigfiles();
void detectArch();
void generateQConfigPri();
void generateSystemVars();
#endif
void showSummary();
void findProjects( const QString& dirName );

View File

@ -78,6 +78,10 @@ int runConfigure( int argc, char** argv )
if (!app.isOk())
return 3;
app.generateSystemVars();
if (!app.isOk())
return 3;
// Auto-detect modules and settings.
app.autoDetection();