aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp')
-rw-r--r--meson/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/meson/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp b/meson/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
new file mode 100644
index 000000000..33f020159
--- /dev/null
+++ b/meson/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;
+}