summaryrefslogtreecommitdiffstats
path: root/Tests/ExternalOBJ
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-11-17 18:49:10 (GMT)
committerBrad King <brad.king@kitware.com>2005-11-17 18:49:10 (GMT)
commit70b4e1051e04be892c86aa3ff729d63ccf1f7771 (patch)
tree780b663a4c900e576b798b4be894372420d12f99 /Tests/ExternalOBJ
parent6ce463dab36091ce77f5b2cb614478d5ab049fe5 (diff)
downloadCMake-70b4e1051e04be892c86aa3ff729d63ccf1f7771.zip
CMake-70b4e1051e04be892c86aa3ff729d63ccf1f7771.tar.gz
CMake-70b4e1051e04be892c86aa3ff729d63ccf1f7771.tar.bz2
BUG: Fixed support for external object files built by custom commands. Also added a test to keep it working.
Diffstat (limited to 'Tests/ExternalOBJ')
-rw-r--r--Tests/ExternalOBJ/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt
index 7607f69..cf95dc5 100644
--- a/Tests/ExternalOBJ/CMakeLists.txt
+++ b/Tests/ExternalOBJ/CMakeLists.txt
@@ -41,5 +41,14 @@ ELSE(EXTERNAL_OBJECT)
MESSAGE(FATAL_ERROR "Could not find ${EXTERNAL_OBJECT_NAME}.")
ENDIF(EXTERNAL_OBJECT)
+# Test creation of external objects by custom commands.
+SET(CUSTOM_OBJECT
+ ${CMAKE_CURRENT_BINARY_DIR}/custom_object${CMAKE_C_OUTPUT_EXTENSION})
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CUSTOM_OBJECT}
+ COMMAND ${CMAKE_COMMAND} -E copy ${EXTERNAL_OBJECT} ${CUSTOM_OBJECT}
+ DEPENDS ${EXTERNAL_OBJECT}
+ )
+
# Build an executable using the external object file.
-ADD_EXECUTABLE(executable executable.cxx ${EXTERNAL_OBJECT})
+ADD_EXECUTABLE(executable executable.cxx ${CUSTOM_OBJECT})