From 798404aeee9d81444008c4457b183e1f88732071 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Feb 2005 15:31:02 -0500 Subject: ENH: Added CMAKE_PROJECT_NAME variable to play the role of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR for the top-level project name. --- Source/cmProjectCommand.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/cmProjectCommand.cxx') diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index f62d8bdac1..627789f7c2 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -48,6 +48,14 @@ bool cmProjectCommand::InitialPass(std::vector 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 languages; if(args.size() > 1) { -- cgit v1.2.1