[Cmake-commits] [cmake-commits] david.cole committed CMakeLists.txt 1.46 1.47

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 25 13:23:22 EDT 2009


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

Modified Files:
	CMakeLists.txt 
Log Message:
Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location...


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.46
retrieving revision 1.47
diff -C 2 -d -r1.46 -r1.47
*** CMakeLists.txt	8 Jul 2009 15:41:15 -0000	1.46
--- CMakeLists.txt	25 Sep 2009 17:23:19 -0000	1.47
***************
*** 387,388 ****
--- 387,415 ----
    )
  ADD_DEPENDENCIES(do_check_command_line pre_check_command_line)
+ 
+ # <SameNameTest>
+ #
+ # Add a custom target called "SameName" -- then add a custom command in a
+ # different target whose output is a full-path file called "SameName" -- then
+ # add a second custom target that depends on the full-path file ".../SameName"
+ #
+ # At first, this reproduces a bug reported by a customer. After fixing it,
+ # having this test here makes sure it stays fixed moving forward.
+ #
+ ADD_CUSTOM_COMMAND(
+   OUTPUT SameName1.txt
+   COMMAND ${CMAKE_COMMAND} -E touch SameName1.txt
+   )
+ ADD_CUSTOM_TARGET(SameName ALL
+   DEPENDS SameName1.txt
+   )
+ 
+ ADD_CUSTOM_COMMAND(
+   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
+   COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
+   )
+ ADD_CUSTOM_TARGET(DifferentName ALL
+   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
+   )
+ #
+ # </SameNameTest>



More information about the Cmake-commits mailing list