summaryrefslogtreecommitdiff
path: root/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-02-19 20:05:19 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-02-20 11:16:37 +0100
commit113ec96626fe7cd2edc0bc4815ae2fc21cfb0546 (patch)
treec793ed45ea352e1f4ceb9ef279f6f96ab64e526c /test cases/cmake/8 custom command/subprojects/cmMod/cpyTest
parent31eb41ec2fd2c7ed06406fb4e5ea87af5010d4e5 (diff)
downloadmeson-113ec96626fe7cd2edc0bc4815ae2fc21cfb0546.tar.gz
cmake: Fix relative paths for add_custom_{command,target}
Do this by tracking CMAKE_CURRENT_{SOURCE,BINARY}_DIR variables. This is achieved by injecting CMake code with CMAKE_PROJECT_INCLUDE and overriding some builtin functions with a wrapper that adds additional trace information.
Diffstat (limited to 'test cases/cmake/8 custom command/subprojects/cmMod/cpyTest')
-rw-r--r--test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt7
-rw-r--r--test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt b/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt
new file mode 100644
index 000000000..f577dcf2a
--- /dev/null
+++ b/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_custom_command(
+ OUTPUT cpyTest4.hpp
+ COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest4.hpp" cpyTest4.hpp
+ DEPENDS cpyTest4.hpp
+)
+
+add_custom_target(tgtCpyTest4 DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpyTest4.hpp")
diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp b/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp
new file mode 100644
index 000000000..4124c430b
--- /dev/null
+++ b/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp
@@ -0,0 +1,3 @@
+#pragma once
+
+#define CPY_TEST_STR_4 " test"