summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qmake/generators/makefile.cpp6
-rw-r--r--tests/auto/qmake/testdata/substitutes/sub/test2.in1
-rw-r--r--tests/auto/qmake/testdata/substitutes/test.in2
-rw-r--r--tests/auto/qmake/testdata/substitutes/test.pro2
-rw-r--r--tests/auto/qmake/testdata/substitutes_build/README1
-rw-r--r--tests/auto/qmake/tst_qmake.cpp16
6 files changed, 25 insertions, 3 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 45a96f5..851e587 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -471,9 +471,9 @@ MakefileGenerator::init()
subs.at(i).toLatin1().constData());
continue;
}
- QFile in(fileFixify(subs.at(i))), out(fileInfo(subs.at(i)).fileName());
- if(out.fileName().endsWith(".in"))
- out.setFileName(out.fileName().left(out.fileName().length()-3));
+ QFile in(fileFixify(subs.at(i)));
+ QFile out(fileFixify(subs.at(i).left(subs.at(i).length()-3),
+ qmake_getpwd(), Option::output_dir));
if(in.open(QFile::ReadOnly)) {
QString contents;
QStack<int> state;
diff --git a/tests/auto/qmake/testdata/substitutes/sub/test2.in b/tests/auto/qmake/testdata/substitutes/sub/test2.in
new file mode 100644
index 0000000..78a6069
--- /dev/null
+++ b/tests/auto/qmake/testdata/substitutes/sub/test2.in
@@ -0,0 +1 @@
+heya
diff --git a/tests/auto/qmake/testdata/substitutes/test.in b/tests/auto/qmake/testdata/substitutes/test.in
new file mode 100644
index 0000000..2fa05e0
--- /dev/null
+++ b/tests/auto/qmake/testdata/substitutes/test.in
@@ -0,0 +1,2 @@
+test
+tst
diff --git a/tests/auto/qmake/testdata/substitutes/test.pro b/tests/auto/qmake/testdata/substitutes/test.pro
new file mode 100644
index 0000000..5bce312
--- /dev/null
+++ b/tests/auto/qmake/testdata/substitutes/test.pro
@@ -0,0 +1,2 @@
+QMAKE_SUBSTITUTES += test.in
+# doesn't work for the time being: sub/test2.in
diff --git a/tests/auto/qmake/testdata/substitutes_build/README b/tests/auto/qmake/testdata/substitutes_build/README
new file mode 100644
index 0000000..81dc596
--- /dev/null
+++ b/tests/auto/qmake/testdata/substitutes_build/README
@@ -0,0 +1 @@
+Placeholder file to ensure this directory exists
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp
index 5efe714..825e49b 100644
--- a/tests/auto/qmake/tst_qmake.cpp
+++ b/tests/auto/qmake/tst_qmake.cpp
@@ -90,6 +90,7 @@ private slots:
void bundle_spaces();
#endif
void includefunction();
+ void substitutes();
private:
TestCompiler test_compiler;
@@ -477,6 +478,21 @@ void tst_qmake::includefunction()
QVERIFY(test_compiler.commandOutput().contains(warningMsg));
}
+void tst_qmake::substitutes()
+{
+ QString workDir = base_path + "/testdata/substitutes";
+ QVERIFY( test_compiler.qmake( workDir, "test" ));
+ QVERIFY( test_compiler.exists( workDir, "test", Exe, "1.0.0" ));
+ //QVERIFY( test_compiler.exists( workDir, "sub/test2", Exe, "1.0.0" ));
+ QVERIFY( test_compiler.makeDistClean( workDir ));
+
+ QString buildDir = base_path + "/testdata/substitutes_build";
+ QVERIFY( test_compiler.qmake( workDir, "test", buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "test", Exe, "1.0.0" ));
+ //QVERIFY( test_compiler.exists( buildDir, "sub/test2", Exe, "1.0.0" ));
+ QVERIFY( test_compiler.makeDistClean( buildDir ));
+}
+
QTEST_MAIN(tst_qmake)
#include "tst_qmake.moc"