diff options
Diffstat (limited to 'test cases/cmake/8 custom command/subprojects/cmMod/main.cpp')
| -rw-r--r-- | test cases/cmake/8 custom command/subprojects/cmMod/main.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp b/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp new file mode 100644 index 000000000..9fade211d --- /dev/null +++ b/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp @@ -0,0 +1,30 @@ +#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; +} |
