summaryrefslogtreecommitdiffstats
path: root/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp')
-rw-r--r--test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp b/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
new file mode 100644
index 0000000..33f0201
--- /dev/null
+++ b/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
@@ -0,0 +1,40 @@
+#include <iostream>
+
+using namespace std;
+
+int main() {
+ cout << R"asd(
+#include <iostream>
+#include <fstream>
+
+using namespace std;
+
+int main(int argc, const char *argv[]) {
+ if(argc < 2) {
+ cerr << argv[0] << " requires an output file!" << endl;
+ return 1;
+ }
+ ofstream out1(string(argv[1]) + ".hpp");
+ ofstream out2(string(argv[1]) + ".cpp");
+ out1 << R"(
+#pragma once
+
+#include <string>
+
+std::string getStr();
+)";
+
+ out2 << R"(
+#include ")" << argv[1] << R"(.hpp"
+
+std::string getStr() {
+ return "Hello World";
+}
+)";
+
+ return 0;
+}
+)asd";
+
+ return 0;
+}