diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/CustomCommand/foo.in | 3 | ||||
-rw-r--r-- | Tests/CustomCommand/gen_once.c.in | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 7e9f29c..5ee0519 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -151,6 +151,14 @@ ADD_EXECUTABLE(CustomCommand ${PROJECT_BINARY_DIR}/generated.c ${PROJECT_BINARY_DIR}/not_included.h gen_redirect.c # default location for custom commands is in build tree + gen_once.c + ) + +# Add a rule with no dependencies. +ADD_CUSTOM_COMMAND( + OUTPUT gen_once.c + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/gen_once.c.in ${PROJECT_BINARY_DIR}/gen_once.c + SKIP_RULE_DEPENDS ) # Add the rule to create generated.c at build time. This is placed diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index 08c559d..c5ce340 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -6,10 +6,11 @@ int generated(); int wrapped(); +int gen_once(void); int main () { - if (generated()*wrapped()*doc() == 3*5*7) + if (generated()*wrapped()*doc()*gen_once() == 3*5*7*11) { FILE* fin = fopen(PROJECT_BINARY_DIR "/not_included.h", "r"); if(fin) diff --git a/Tests/CustomCommand/gen_once.c.in b/Tests/CustomCommand/gen_once.c.in new file mode 100644 index 0000000..dc8eb67 --- /dev/null +++ b/Tests/CustomCommand/gen_once.c.in @@ -0,0 +1 @@ +int gen_once(void) { return 11; } |