[cmake-commits] king committed CMakeLists.txt 1.34 1.35

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jun 11 13:22:19 EDT 2007


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

Modified Files:
	CMakeLists.txt 
Log Message:
ENH: Re-arranged code to test adding a custom command to generate a source file after the file has been added to a target.  This is supported by the current implementation because of the use of source lists in the target implementation.  When we later convert to creating cmSourceFile instances immediately for the target we need to make sure the mentioned case still works.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- CMakeLists.txt	18 May 2007 13:33:59 -0000	1.34
+++ CMakeLists.txt	11 Jun 2007 17:22:17 -0000	1.35
@@ -27,15 +27,6 @@
 GET_TARGET_PROPERTY(generator_PATH generator LOCATION)
 MESSAGE("Location ${generator_PATH}")
 
-# the folowing assumes that a cmSourceFile
-# is instantiated for the output, with GENERATED 1
-# at the end of the day this becomes a what in VS ?
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c
-  DEPENDS generator
-  COMMAND ${generator_PATH}
-  ARGS ${PROJECT_BINARY_DIR}/generated.c
-  )
-
 ################################################################
 #
 #  Test using a wrapper to wrap a header file
@@ -44,9 +35,6 @@
 # add the executable that will generate the file
 ADD_EXECUTABLE(wrapper wrapper.cxx)
 
-# the following assumes that a cmSourceFile
-# is instantiated for the output, with GENERATED 1
-# at the end of the day this becomes a what in VS ?
 ADD_CUSTOM_COMMAND(
   OUTPUT ${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c
   DEPENDS wrapper
@@ -161,6 +149,15 @@
   ${PROJECT_BINARY_DIR}/not_included.h
   )
 
+# Add the rule to create generated.c at build time.  This is placed
+# here to test adding the generation rule after referencing the
+# generated source in a target.
+ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c
+  DEPENDS generator
+  COMMAND ${generator_PATH}
+  ARGS ${PROJECT_BINARY_DIR}/generated.c
+  )
+
 TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader)
 
 # must add a dependency on TDocument otherwise it might never build and 



More information about the Cmake-commits mailing list