mirror of
https://github.com/reactos/CMake.git
synced 2025-01-22 11:24:56 +00:00
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.
This commit is contained in:
parent
b27247c8df
commit
f8a086a86b
@ -44,6 +44,7 @@ Variables corresponding to unspecified versions are set to the empty string
|
||||
|
||||
If the optional ``DESCRIPTION`` is given, then :variable:`PROJECT_DESCRIPTION`
|
||||
and :variable:`<PROJECT-NAME>_DESCRIPTION` will be set to its argument.
|
||||
These variables will be cleared if ``DESCRIPTION`` is not given.
|
||||
The description is expected to be a relatively short string, usually no more
|
||||
than a few words.
|
||||
|
||||
@ -51,6 +52,7 @@ The optional ``HOMEPAGE_URL`` sets the analogous variables
|
||||
:variable:`PROJECT_HOMEPAGE_URL` and :variable:`<PROJECT-NAME>_HOMEPAGE_URL`.
|
||||
When this option is given, the URL provided should be the canonical home for
|
||||
the project.
|
||||
These variables will be cleared if ``HOMEPAGE_URL`` is not given.
|
||||
|
||||
Note that the description and homepage URL may be used as defaults for
|
||||
things like packaging meta-data, documentation, etc.
|
||||
|
@ -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++
|
||||
|
Loading…
x
Reference in New Issue
Block a user