summaryrefslogtreecommitdiffstats
path: root/Tests/BuildDepends/Project
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-23 17:30:23 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-23 17:30:23 (GMT)
commit303b4312b2c28329a2aecde7d7ddd84137efa1ce (patch)
tree2feac95a9e9aecf78ed4cf2407bf8520c930a56f /Tests/BuildDepends/Project
parentc288da754a3f1221ca4ebfd9c9efb8c935d499d6 (diff)
downloadCMake-303b4312b2c28329a2aecde7d7ddd84137efa1ce.zip
CMake-303b4312b2c28329a2aecde7d7ddd84137efa1ce.tar.gz
CMake-303b4312b2c28329a2aecde7d7ddd84137efa1ce.tar.bz2
BUG: Target names in the COMMAND part of a custom command should not create a file-level dependency that forces the command to rerun when the executable target rebuilds, but the target-level dependency should still be created. Target names in a DEPENDS should do both a target-level and file-level dependency. Updated the BuildDepends test to check that this works.
Diffstat (limited to 'Tests/BuildDepends/Project')
-rw-r--r--Tests/BuildDepends/Project/generator.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/BuildDepends/Project/generator.cxx b/Tests/BuildDepends/Project/generator.cxx
new file mode 100644
index 0000000..92a122d
--- /dev/null
+++ b/Tests/BuildDepends/Project/generator.cxx
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+extern const char* foo();
+
+int main(int argc, const char* argv[])
+{
+ if(argc < 3)
+ {
+ fprintf(stderr, "Must specify output file and symbol prefix!");
+ return 1;
+ }
+ if(FILE* fout = fopen(argv[1], "w"))
+ {
+ fprintf(fout, "static const char* %s_string = \"%s\";\n", argv[2],
+ foo());
+ fclose(fout);
+ }
+ else
+ {
+ fprintf(stderr, "Could not open output file \"%s\"", argv[1]);
+ return 1;
+ }
+ return 0;
+}