aboutsummaryrefslogtreecommitdiff
path: root/test cases/cmake
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-04-12 23:46:09 +0300
committerGitHub <noreply@github.com>2020-04-12 23:46:09 +0300
commit3d99f67aea55728ba7aff4434dd186f1a2f18e1b (patch)
tree0b9710780449dfeb0d6230aa7e9fd4123172fdda /test cases/cmake
parente929e67555f83d0718cfe5ad3c8e978c2aa1589c (diff)
parent1be660ff64f2cb69cac0376ae57f65908b34238b (diff)
downloadmeson-3d99f67aea55728ba7aff4434dd186f1a2f18e1b.zip
meson-3d99f67aea55728ba7aff4434dd186f1a2f18e1b.tar.gz
meson-3d99f67aea55728ba7aff4434dd186f1a2f18e1b.tar.bz2
Merge pull request #6963 from mensinda/cmFixCCmd
cmake: some fixes for add_custom_command
Diffstat (limited to 'test cases/cmake')
-rw-r--r--test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt9
-rw-r--r--test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp (renamed from test cases/cmake/8 custom command/subprojects/cmMod/main.cpp)10
2 files changed, 19 insertions, 0 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 39b19d7..1498c36 100644
--- a/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt
+++ b/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt
@@ -7,6 +7,9 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions("-DDO_NOTHING_JUST_A_FLAG=1")
+add_executable(genMain genMain.cpp)
+add_custom_command(OUTPUT main.cpp COMMAND genMain > main.cpp)
+
add_executable(gen main.cpp)
add_executable(mycpy cp.cpp)
@@ -16,9 +19,15 @@ add_custom_command(
COMMAND gen ARGS genTest
)
+set(CMD_PART)
+list(APPEND CMD_PART COMMAND mycpy cpyBase.cpp.in cpyBase.cpp.in.gen)
+list(APPEND CMD_PART COMMAND mycpy cpyBase.cpp.in.gen cpyBase.cpp.out)
+list(APPEND CMD_PART COMMAND mycpy cpyBase.cpp.out cpyBase.cpp.something)
+
add_custom_command(
OUTPUT cpyBase.cpp
COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyBase.cpp.am" cpyBase.cpp.in
+ ${CMD_PART}
COMMAND mycpy cpyBase.cpp.in cpyBase.cpp.something
COMMAND mycpy cpyBase.cpp.something cpyBase.cpp.IAmRunningOutOfIdeas
COMMAND mycpy cpyBase.cpp.IAmRunningOutOfIdeas cpyBase.cpp
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp b/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
index 9fade21..33f0201 100644
--- a/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp
+++ b/test cases/cmake/8 custom command/subprojects/cmMod/genMain.cpp
@@ -1,4 +1,10 @@
#include <iostream>
+
+using namespace std;
+
+int main() {
+ cout << R"asd(
+#include <iostream>
#include <fstream>
using namespace std;
@@ -28,3 +34,7 @@ std::string getStr() {
return 0;
}
+)asd";
+
+ return 0;
+}