summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-22 11:19:09 -0500
committerBrad King <brad.king@kitware.com>2019-02-22 11:19:09 -0500
commit6ebe40c6ae736157c2cd036ee01b771ae399b11d (patch)
tree785a8455f0f2d995f1b816c4957138baff49271b
parentc925166764800be637ffc6d1df5086ebcabb766d (diff)
parentd3b765d4510b73ee17df0e2bee0f7b9a355c5cba (diff)
downloadcmake-6ebe40c6ae736157c2cd036ee01b771ae399b11d.tar.gz
Merge branch 'remove-exclude-from-all-warning' into release-3.14
Merge-request: !3002
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst12
-rw-r--r--Help/release/3.14.rst4
-rw-r--r--Source/cmInstallTargetGenerator.cxx16
-rw-r--r--Source/cmInstallTargetGenerator.h1
-rw-r--r--Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt1
5 files changed, 14 insertions, 20 deletions
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index e7457e1e29..0eee297921 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -6,8 +6,16 @@ Exclude the target from the all target.
A property on a target that indicates if the target is excluded from
the default build target. If it is not, then with a Makefile for
example typing make will cause this target to be built. The same
-concept applies to the default build of other generators. Installing
-a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
+concept applies to the default build of other generators.
+
+With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
+will be brought up to date as part of doing a ``make install`` or its
+equivalent for the CMake generator being used. If a target has
+``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
+target has undefined behavior. Note that such a target can still safely
+be listed in an :command:`install(TARGETS)` command as long as the install
+components the target belongs to are not part of the set of components
+that anything tries to install.
This property is enabled by default for targets that are created in
directories that have :prop_dir:`EXCLUDE_FROM_ALL` set to ``TRUE``.
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
index a04005c358..d03046ac74 100644
--- a/Help/release/3.14.rst
+++ b/Help/release/3.14.rst
@@ -370,3 +370,7 @@ Other Changes
:variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
never supported the PAX tar format. The ``paxr`` value will be mapped
to ``gnutar`` and a deprecation message emitted.
+
+* CMake no longer issues a warning if a target listed in an
+ :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL`
+ property set to true.
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 59701a136b..9d3a6bb60e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -41,22 +41,6 @@ cmInstallTargetGenerator::cmInstallTargetGenerator(
cmInstallTargetGenerator::~cmInstallTargetGenerator() = default;
-void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
-{
- // Warn if installing an exclude-from-all target.
- if (this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- std::ostringstream msg;
- msg << "WARNING: Target \"" << this->Target->GetName()
- << "\" has EXCLUDE_FROM_ALL set and will not be built by default "
- << "but an install rule has been provided for it. CMake does "
- << "not define behavior for this case.";
- cmSystemTools::Message(msg.str(), "Warning");
- }
-
- // Perform the main install script generation.
- this->cmInstallGenerator::GenerateScript(os);
-}
-
void cmInstallTargetGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
{
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 715b4ae69f..6df5b1a50a 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -69,7 +69,6 @@ public:
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
protected:
- void GenerateScript(std::ostream& os) override;
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
void GenerateScriptForConfigObjectLibrary(std::ostream& os,
diff --git a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt b/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
deleted file mode 100644
index 86e3ec0760..0000000000
--- a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^WARNING: Target "notall" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it\. CMake does not define behavior for this case\.$