diff options
Diffstat (limited to 'test cases/cmake')
3 files changed, 20 insertions, 1 deletions
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt index ec56105..3c3297e 100644 --- a/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5) project(cmMod) set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD_REQUIRED ON) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") @@ -48,9 +49,12 @@ generate_export_header(cmModLib) set(ARGS_TEST arg1) set(ARGS_TEST ${ARGS_TEST} arg2) +add_executable(macro_name macro_name.cpp) add_executable(args_test args_test.cpp) add_custom_target(args_test_cmd COMMAND args_test ARGS ${ARGS_TEST} ) +add_custom_target(macro_name_cmd COMMAND macro_name) add_dependencies(cmModLib args_test_cmd) +add_dependencies(args_test_cmd macro_name_cmd) diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp b/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp index 243e597..abb8a42 100644 --- a/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp +++ b/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp @@ -9,8 +9,9 @@ int main(int argc, const char *argv[]) { return 1; } + ifstream in1("macro_name.txt"); ofstream out1("cmModLib.hpp"); - out1 << "#define FOO = \"plop\""; + out1 << "#define " << in1.rdbuf() << " = \"plop\""; return 0; diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp b/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp new file mode 100644 index 0000000..790557b --- /dev/null +++ b/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp @@ -0,0 +1,14 @@ +#include <iostream> +#include <fstream> +#include <chrono> +#include <thread> + +using namespace std; + +int main() { + this_thread::sleep_for(chrono::seconds(1)); + ofstream out1("macro_name.txt"); + out1 << "FOO"; + + return 0; +} |