diff options
| author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-04-12 15:11:54 +0200 |
|---|---|---|
| committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-04-12 15:11:54 +0200 |
| commit | 1be660ff64f2cb69cac0376ae57f65908b34238b (patch) | |
| tree | a1b9d7a446b2706db34db3ed27ec65e553ff2e55 /test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp | |
| parent | 4199cb32a513370b6dd68ea90cdd0e5b852dff23 (diff) | |
| download | meson-1be660ff64f2cb69cac0376ae57f65908b34238b.tar.gz | |
cmake: Capture stdout with UNIX pipes
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.cpp | 40 |
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 000000000..33f020159 --- /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; +} |
