[cmake-commits] king committed CMakeLists.txt 1.26 1.27 check_mark.cmake NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Tue May 1 14:12:58 EDT 2007


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

Modified Files:
	CMakeLists.txt 
Added Files:
	check_mark.cmake 
Log Message:
ENH: Added test to make sure custom commands are not built more than once in a single build.  This tests for a bug introduced by one fix and fixed by another fix for bug#4377.


--- NEW FILE: check_mark.cmake ---
IF(EXISTS "${MARK_FILE}")
  MESSAGE(FATAL_ERROR "Custom command run more than once!")
ELSE(EXISTS "${MARK_FILE}")
  FILE(WRITE "${MARK_FILE}" "check for running custom command twice\n")
ENDIF(EXISTS "${MARK_FILE}")

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- CMakeLists.txt	25 Oct 2006 15:23:23 -0000	1.26
+++ CMakeLists.txt	1 May 2007 18:12:56 -0000	1.27
@@ -230,6 +230,8 @@
   ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
+  COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
+  -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake
   COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
   ${CHECK_ARGS}
   VERBATIM
@@ -246,3 +248,8 @@
   COMMENT "Checking custom target command line escapes ($dollar-signs$)"
   )
 ADD_DEPENDENCIES(do_check_command_line check_command_line)
+
+ADD_CUSTOM_TARGET(pre_check_command_line
+  COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
+  )
+ADD_DEPENDENCIES(do_check_command_line pre_check_command_line)



More information about the Cmake-commits mailing list