summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-10-07 21:18:50 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-10-07 21:28:17 (GMT)
commitf8a086a86bd3f9301f04e5ad64b75fe960eee99a (patch)
treeada2aceb55ee583d2ccb1f0c9b88526d593cb3f9 /Source
parentb27247c8df5c88193304149269ab0dbb0e8c35e4 (diff)
downloadCMake-f8a086a86bd3f9301f04e5ad64b75fe960eee99a.zip
CMake-f8a086a86bd3f9301f04e5ad64b75fe960eee99a.tar.gz
CMake-f8a086a86bd3f9301f04e5ad64b75fe960eee99a.tar.bz2
project(): Ensure DESCRIPTION and HOMEPAGE_URL variables are set
If a project() call does not have DESCRIPTION or HOMEPAGE_URL options, it must still set the relevant variables or else those variables will inherit values from an earlier project() call. That is inconsistent with how VERSION is handled and is likely to be unexpected. The docs were also ambiguous about what should happen in such cases.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmProjectCommand.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 305c7a6..8f565c8 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -300,19 +300,15 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
}
}
- if (haveDescription) {
- this->Makefile->AddDefinition("PROJECT_DESCRIPTION", description.c_str());
- this->Makefile->AddDefinition(projectName + "_DESCRIPTION",
- description.c_str());
- TopLevelCMakeVarCondSet("CMAKE_PROJECT_DESCRIPTION", description.c_str());
- }
+ this->Makefile->AddDefinition("PROJECT_DESCRIPTION", description.c_str());
+ this->Makefile->AddDefinition(projectName + "_DESCRIPTION",
+ description.c_str());
+ TopLevelCMakeVarCondSet("CMAKE_PROJECT_DESCRIPTION", description.c_str());
- if (haveHomepage) {
- this->Makefile->AddDefinition("PROJECT_HOMEPAGE_URL", homepage.c_str());
- this->Makefile->AddDefinition(projectName + "_HOMEPAGE_URL",
- homepage.c_str());
- TopLevelCMakeVarCondSet("CMAKE_PROJECT_HOMEPAGE_URL", homepage.c_str());
- }
+ this->Makefile->AddDefinition("PROJECT_HOMEPAGE_URL", homepage.c_str());
+ this->Makefile->AddDefinition(projectName + "_HOMEPAGE_URL",
+ homepage.c_str());
+ TopLevelCMakeVarCondSet("CMAKE_PROJECT_HOMEPAGE_URL", homepage.c_str());
if (languages.empty()) {
// if no language is specified do c and c++