summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends/Project
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-14 15:55:12 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-14 15:55:12 (GMT)
commit91de0b09ef468138ec0f11ea90c90f1e2162e077 (patch)
treec8f8bddd473c54db531ae367e6fdf5c72bf3dd2f /Tests/BuildDepends/Project
parenta1bb7e90ef878c41f9725f0f7000b027f8dcd14a (diff)
downloadCMake-91de0b09ef468138ec0f11ea90c90f1e2162e077.zip
CMake-91de0b09ef468138ec0f11ea90c90f1e2162e077.tar.gz
CMake-91de0b09ef468138ec0f11ea90c90f1e2162e077.tar.bz2
ENH: Update BuildDepends test to check #include lines with macros.
- Tests IMPLICIT_DEPENDS_INCLUDE_TRANSFORM properties. - See issue #6648. - Works without help in VS IDEs due to native dependency handling. - Xcode needs help to rebuild correctly.
Diffstat (limited to 'Tests/BuildDepends/Project')
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt15
-rw-r--r--Tests/BuildDepends/Project/zot.cxx6
-rw-r--r--Tests/BuildDepends/Project/zot_macro_dir.cxx7
-rw-r--r--Tests/BuildDepends/Project/zot_macro_tgt.cxx7
4 files changed, 33 insertions, 2 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 01bbf44..23aac4d 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
project(testRebuild)
add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx)
@@ -57,5 +58,17 @@ add_custom_command(
add_custom_target(zot_custom ALL DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx)
-add_executable(zot zot.cxx ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx)
+add_executable(zot zot.cxx ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx
+ zot_macro_dir.cxx zot_macro_tgt.cxx)
add_dependencies(zot zot_custom)
+
+# Test the #include line macro transformation rule support.
+set_property(
+ TARGET zot
+ PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "ZOT_TGT(%)=<zot_%_tgt.hxx>"
+ )
+
+set_property(
+ DIRECTORY
+ PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "ZOT_DIR(%)=<zot_%_dir.hxx>"
+ )
diff --git a/Tests/BuildDepends/Project/zot.cxx b/Tests/BuildDepends/Project/zot.cxx
index 356b078..775fd3b 100644
--- a/Tests/BuildDepends/Project/zot.cxx
+++ b/Tests/BuildDepends/Project/zot.cxx
@@ -2,9 +2,13 @@
#include <zot_custom.hxx>
#include <stdio.h>
+const char* zot_macro_dir_f();
+const char* zot_macro_tgt_f();
+
int main()
{
- printf("[%s] [%s]\n", zot, zot_custom);
+ printf("[%s] [%s] [%s] [%s]\n", zot, zot_custom,
+ zot_macro_dir_f(), zot_macro_tgt_f());
fflush(stdout);
return 0;
}
diff --git a/Tests/BuildDepends/Project/zot_macro_dir.cxx b/Tests/BuildDepends/Project/zot_macro_dir.cxx
new file mode 100644
index 0000000..733a4b3
--- /dev/null
+++ b/Tests/BuildDepends/Project/zot_macro_dir.cxx
@@ -0,0 +1,7 @@
+#define ZOT_DIR(x) <zot_##x##_dir.hxx>
+#include ZOT_DIR(macro)
+
+const char* zot_macro_dir_f()
+{
+ return zot_macro_dir;
+}
diff --git a/Tests/BuildDepends/Project/zot_macro_tgt.cxx b/Tests/BuildDepends/Project/zot_macro_tgt.cxx
new file mode 100644
index 0000000..182ee16
--- /dev/null
+++ b/Tests/BuildDepends/Project/zot_macro_tgt.cxx
@@ -0,0 +1,7 @@
+#define ZOT_TGT(x) <zot_##x##_tgt.hxx>
+#include ZOT_TGT(macro)
+
+const char* zot_macro_tgt_f()
+{
+ return zot_macro_tgt;
+}