[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.39 1.40 foo.in 1.3 1.4 gen_once.c.in NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Wed May 14 11:38:49 EDT 2008


Update of /cvsroot/CMake/CMake/Tests/CustomCommand
In directory public:/mounts/ram/cvs-serv28474/Tests/CustomCommand

Modified Files:
	CMakeLists.txt foo.in 
Added Files:
	gen_once.c.in 
Log Message:
ENH: Add SKIP_RULE_DEPENDS option for add_custom_command()

  - Allows make rules to be created with no dependencies.
  - Such rules will not re-run even if the commands themselves change.
  - Useful to create rules that run only if the output is missing.


Index: foo.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/foo.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** foo.in	1 Jun 2006 17:01:31 -0000	1.3
--- foo.in	14 May 2008 15:38:47 -0000	1.4
***************
*** 7,14 ****
  int generated();
  int wrapped();
  
  int main ()
  {
!   if (generated()*wrapped()*doc() == 3*5*7)
      {
      FILE* fin = fopen(PROJECT_BINARY_DIR "/not_included.h", "r");
--- 7,15 ----
  int generated();
  int wrapped();
+ int gen_once(void);
  
  int main ()
  {
!   if (generated()*wrapped()*doc()*gen_once() == 3*5*7*11)
      {
      FILE* fin = fopen(PROJECT_BINARY_DIR "/not_included.h", "r");

--- NEW FILE: gen_once.c.in ---
int gen_once(void) { return 11; }

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.39
retrieving revision 1.40
diff -C 2 -d -r1.39 -r1.40
*** CMakeLists.txt	30 Apr 2008 19:58:45 -0000	1.39
--- CMakeLists.txt	14 May 2008 15:38:46 -0000	1.40
***************
*** 152,155 ****
--- 152,163 ----
    ${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
    )
  



More information about the Cmake-commits mailing list