summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-01 20:41:19 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-01 21:00:12 (GMT)
commitfea3e84ee3670e2d6b333d844ea431cf6f193e67 (patch)
tree665473330d17647942a44d301300693b9aa75503
parent363d3962c476a6018c0be9fde18f347816034b97 (diff)
downloadCMake-fea3e84ee3670e2d6b333d844ea431cf6f193e67.zip
CMake-fea3e84ee3670e2d6b333d844ea431cf6f193e67.tar.gz
CMake-fea3e84ee3670e2d6b333d844ea431cf6f193e67.tar.bz2
export(): Document undefined behavior of location properties
Since the export() command needs to know the final location of a target in the build tree we cannot allow properties affecting the location or name of a target file to be set after the target is passed to export(). Fix a violation of this rule in the SimpleInstall test.
-rw-r--r--Source/cmExportCommand.h2
-rw-r--r--Tests/SimpleInstall/CMakeLists.txt11
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt11
3 files changed, 14 insertions, 10 deletions
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index f33e9e2..eb19d2e 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -13,6 +13,7 @@
#define cmExportCommand_h
#include "cmCommand.h"
+#include "cmDocumentLocationUndefined.h"
class cmExportBuildFileGenerator;
@@ -80,6 +81,7 @@ public:
"should never be installed. "
"See the install(EXPORT) command to export targets from an "
"installation tree."
+ CM_LOCATION_UNDEFINED_BEHAVIOR("passing it to this command")
"\n"
" export(PACKAGE <name>)\n"
"Store the current build directory in the CMake user package registry "
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index 564db9f..378b529 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -173,6 +173,12 @@ ELSE(STAGE2)
TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
SET(install_target SimpleInstall)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
+ # Disable VERSION test until it is implemented in the Xcode generator.
+ IF(NOT XCODE)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
+ ENDIF(NOT XCODE)
+
# Make sure the test executable can run from the install tree.
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
@@ -293,11 +299,6 @@ ELSE(STAGE2)
ADDITIONAL_MAKE_CLEAN_FILES
"${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
- SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
- # Disable VERSION test until it is implemented in the Xcode generator.
- IF(NOT XCODE)
- SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
- ENDIF(NOT XCODE)
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index 564db9f..378b529 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -173,6 +173,12 @@ ELSE(STAGE2)
TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
SET(install_target SimpleInstall)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
+ # Disable VERSION test until it is implemented in the Xcode generator.
+ IF(NOT XCODE)
+ SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
+ ENDIF(NOT XCODE)
+
# Make sure the test executable can run from the install tree.
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
@@ -293,11 +299,6 @@ ELSE(STAGE2)
ADDITIONAL_MAKE_CLEAN_FILES
"${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
- SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
- # Disable VERSION test until it is implemented in the Xcode generator.
- IF(NOT XCODE)
- SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
- ENDIF(NOT XCODE)
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT