summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-12-06 20:05:28 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-12-06 20:05:28 (GMT)
commit01e825332ccb5773c716b18687c2862addca0db5 (patch)
tree4695797002a61a4ba5a2dfd318e7d2629ef16d48 /Source
parent759323ad0b93ba9b31eb736988df382d0cc1fe7f (diff)
parentfea3e84ee3670e2d6b333d844ea431cf6f193e67 (diff)
downloadCMake-01e825332ccb5773c716b18687c2862addca0db5.zip
CMake-01e825332ccb5773c716b18687c2862addca0db5.tar.gz
CMake-01e825332ccb5773c716b18687c2862addca0db5.tar.bz2
Merge topic 'export-final-location'
fea3e84 export(): Document undefined behavior of location properties 363d396 Factor out target location undefined behavior helper macro
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/cmDocumentLocationUndefined.h24
-rw-r--r--Source/cmExportCommand.h2
-rw-r--r--Source/cmTarget.cxx14
4 files changed, 30 insertions, 11 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2aa32d8..b5115b7 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -162,6 +162,7 @@ SET(SRCS
cmDocumentationSection.cxx
cmDocumentCompileDefinitions.h
cmDocumentGeneratorExpressions.h
+ cmDocumentLocationUndefined.h
cmDocumentVariables.cxx
cmDynamicLoader.cxx
cmDynamicLoader.h
diff --git a/Source/cmDocumentLocationUndefined.h b/Source/cmDocumentLocationUndefined.h
new file mode 100644
index 0000000..d1be77a
--- /dev/null
+++ b/Source/cmDocumentLocationUndefined.h
@@ -0,0 +1,24 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmDocumentLocationUndefined_h
+#define cmDocumentLocationUndefined_h
+
+#define CM_LOCATION_UNDEFINED_BEHAVIOR(action) \
+ "\n" \
+ "Do not set properties that affect the location of a target after " \
+ action ". These include properties whose names match " \
+ "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\" " \
+ "or \"(IMPLIB_)?(PREFIX|SUFFIX)\". " \
+ "Failure to follow this rule is not diagnosed and leaves the location " \
+ "of the target undefined."
+
+#endif
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/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d021990..7e02a39 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -17,6 +17,7 @@
#include "cmGlobalGenerator.h"
#include "cmComputeLinkInformation.h"
#include "cmDocumentCompileDefinitions.h"
+#include "cmDocumentLocationUndefined.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
#include <cmsys/RegularExpression.hxx>
@@ -584,15 +585,6 @@ void cmTarget::DefineProperties(cmake *cm)
"value is the default. "
"See documentation of CMAKE_<LANG>_LINKER_PREFERENCE variables.");
-#define CM_LOCATION_UNDEFINED_BEHAVIOR \
- "\n" \
- "Do not set properties that affect the location of the target after " \
- "reading this property. These include properties whose names match " \
- "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\" " \
- "or \"(IMPLIB_)?(PREFIX|SUFFIX)\". " \
- "Failure to follow this rule is not diagnosed and leaves the location " \
- "of the target undefined."
-
cm->DefineProperty
("LOCATION", cmProperty::TARGET,
"Read-only location of a target on disk.",
@@ -612,7 +604,7 @@ void cmTarget::DefineProperties(cmake *cm)
"In CMake 2.8.4 and above add_custom_command recognizes generator "
"expressions to refer to target locations anywhere in the command. "
"Therefore this property is not needed for creating custom commands."
- CM_LOCATION_UNDEFINED_BEHAVIOR);
+ CM_LOCATION_UNDEFINED_BEHAVIOR("reading this property"));
cm->DefineProperty
("LOCATION_<CONFIG>", cmProperty::TARGET,
@@ -626,7 +618,7 @@ void cmTarget::DefineProperties(cmake *cm)
"arbitrary available configuration. "
"Use the MAP_IMPORTED_CONFIG_<CONFIG> property to map imported "
"configurations explicitly."
- CM_LOCATION_UNDEFINED_BEHAVIOR);
+ CM_LOCATION_UNDEFINED_BEHAVIOR("reading this property"));
cm->DefineProperty
("LINK_DEPENDS", cmProperty::TARGET,