fix setup of output directory for subprojects in IDE generator backends
unlike before, the output dir is now important already during the project evaluation phase, as finding .qmake.conf depends on it if .qmake.cache is also present. ChangeLog: fixed qmake -tp vc (and configure without -no-vcproj) Change-Id: Ifdb95f3b38a70c0d08e71238059292e761dcfa53 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
79a144d746
commit
ec145129c3
@ -136,6 +136,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
QList<ProjectBuilderSubDirs*> pb_subdirs;
|
QList<ProjectBuilderSubDirs*> pb_subdirs;
|
||||||
pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false));
|
pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false));
|
||||||
QString oldpwd = qmake_getpwd();
|
QString oldpwd = qmake_getpwd();
|
||||||
|
QString oldoutpwd = Option::output_dir;
|
||||||
QMap<QString, ProStringList> groups;
|
QMap<QString, ProStringList> groups;
|
||||||
for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) {
|
for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) {
|
||||||
ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir];
|
ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir];
|
||||||
@ -172,6 +173,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
if(!qmake_setpwd(dir))
|
if(!qmake_setpwd(dir))
|
||||||
fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData());
|
fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData());
|
||||||
}
|
}
|
||||||
|
Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath()));
|
||||||
if(tmp_proj.read(fn)) {
|
if(tmp_proj.read(fn)) {
|
||||||
if(tmp_proj.first("TEMPLATE") == "subdirs") {
|
if(tmp_proj.first("TEMPLATE") == "subdirs") {
|
||||||
QMakeProject *pp = new QMakeProject(&tmp_proj);
|
QMakeProject *pp = new QMakeProject(&tmp_proj);
|
||||||
@ -189,13 +191,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
bool in_root = true;
|
bool in_root = true;
|
||||||
QString name = qmake_getpwd();
|
QString name = qmake_getpwd();
|
||||||
if(project->isActiveConfig("flat")) {
|
if(project->isActiveConfig("flat")) {
|
||||||
QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative);
|
QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
|
||||||
if(flat_file.indexOf(Option::dir_sep) != -1) {
|
if(flat_file.indexOf(Option::dir_sep) != -1) {
|
||||||
QStringList dirs = flat_file.split(Option::dir_sep);
|
QStringList dirs = flat_file.split(Option::dir_sep);
|
||||||
name = dirs.back();
|
name = dirs.back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative);
|
QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
|
||||||
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
|
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
|
||||||
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
|
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
|
||||||
QStringList dirs = flat_file.split(Option::dir_sep);
|
QStringList dirs = flat_file.split(Option::dir_sep);
|
||||||
@ -280,6 +282,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
}
|
}
|
||||||
nextfile:
|
nextfile:
|
||||||
qmake_setpwd(oldpwd);
|
qmake_setpwd(oldpwd);
|
||||||
|
Option::output_dir = oldoutpwd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,18 +434,21 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
projLookup.insert(profileKey, fi.absoluteFilePath());
|
projLookup.insert(profileKey, fi.absoluteFilePath());
|
||||||
}
|
}
|
||||||
QString oldpwd = qmake_getpwd();
|
QString oldpwd = qmake_getpwd();
|
||||||
|
QString oldoutpwd = Option::output_dir;
|
||||||
QMakeProject tmp_proj;
|
QMakeProject tmp_proj;
|
||||||
QString dir = fi.absolutePath(), fn = fi.fileName();
|
QString dir = fi.absolutePath(), fn = fi.fileName();
|
||||||
if (!dir.isEmpty()) {
|
if (!dir.isEmpty()) {
|
||||||
if (!qmake_setpwd(dir))
|
if (!qmake_setpwd(dir))
|
||||||
fprintf(stderr, "Cannot find directory: %s", dir.toLatin1().constData());
|
fprintf(stderr, "Cannot find directory: %s", dir.toLatin1().constData());
|
||||||
}
|
}
|
||||||
|
Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath()));
|
||||||
if (tmp_proj.read(fn)) {
|
if (tmp_proj.read(fn)) {
|
||||||
// Check if all requirements are fulfilled
|
// Check if all requirements are fulfilled
|
||||||
if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) {
|
if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) {
|
||||||
fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n",
|
fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n",
|
||||||
fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
|
fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
|
||||||
qmake_setpwd(oldpwd);
|
qmake_setpwd(oldpwd);
|
||||||
|
Option::output_dir = oldoutpwd;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tmp_proj.first("TEMPLATE") == "vcsubdirs") {
|
if (tmp_proj.first("TEMPLATE") == "vcsubdirs") {
|
||||||
@ -460,13 +463,10 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
// and to be able to extract all the dependencies
|
// and to be able to extract all the dependencies
|
||||||
Option::QMAKE_MODE old_mode = Option::qmake_mode;
|
Option::QMAKE_MODE old_mode = Option::qmake_mode;
|
||||||
Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
|
Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
|
||||||
QString old_output_dir = Option::output_dir;
|
|
||||||
Option::output_dir = QFileInfo(fileFixify(dir, qmake_getpwd(), Option::output_dir)).canonicalFilePath();
|
|
||||||
VcprojGenerator tmp_vcproj;
|
VcprojGenerator tmp_vcproj;
|
||||||
tmp_vcproj.setNoIO(true);
|
tmp_vcproj.setNoIO(true);
|
||||||
tmp_vcproj.setProjectFile(&tmp_proj);
|
tmp_vcproj.setProjectFile(&tmp_proj);
|
||||||
Option::qmake_mode = old_mode;
|
Option::qmake_mode = old_mode;
|
||||||
Option::output_dir = old_output_dir;
|
|
||||||
|
|
||||||
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
|
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
|
||||||
QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"));
|
QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"));
|
||||||
@ -578,6 +578,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
|||||||
}
|
}
|
||||||
nextfile:
|
nextfile:
|
||||||
qmake_setpwd(oldpwd);
|
qmake_setpwd(oldpwd);
|
||||||
|
Option::output_dir = oldoutpwd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user