summaryrefslogtreecommitdiffstats
path: root/Source/cmProjectCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-22 20:31:02 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-22 20:31:02 (GMT)
commit798404aeee9d81444008c4457b183e1f88732071 (patch)
treed1f486eb4b6bd337cba12bed36d5309d9ffa5f6d /Source/cmProjectCommand.cxx
parent7c7b173042106c630fe625d62a82d8235577a1f5 (diff)
downloadCMake-798404aeee9d81444008c4457b183e1f88732071.zip
CMake-798404aeee9d81444008c4457b183e1f88732071.tar.gz
CMake-798404aeee9d81444008c4457b183e1f88732071.tar.bz2
ENH: Added CMAKE_PROJECT_NAME variable to play the role of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR for the top-level project name.
Diffstat (limited to 'Source/cmProjectCommand.cxx')
-rw-r--r--Source/cmProjectCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index f62d8bd..627789f 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -48,6 +48,14 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args)
m_Makefile->AddDefinition("PROJECT_NAME", args[0].c_str());
+ // Set the CMAKE_PROJECT_NAME variable to be the highest-level
+ // project name in the tree. This is always the first PROJECT
+ // command encountered.
+ if(!m_Makefile->GetDefinition("CMAKE_PROJECT_NAME"))
+ {
+ m_Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str());
+ }
+
std::vector<std::string> languages;
if(args.size() > 1)
{