1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmProjectCommand.cxx,v $
6 Date: $Date: 2002-04-05 17:08:12 $
7 Version: $Revision: 1.14 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmProjectCommand.h"
20 bool cmProjectCommand::InitialPass(std::vector
<std::string
> const& argsIn
)
22 if(argsIn
.size() < 1 )
24 this->SetError("PROJECT called with incorrect number of arguments");
27 std::vector
<std::string
> args
;
28 cmSystemTools::ExpandListArguments(argsIn
, args
);
29 m_Makefile
->SetProjectName(args
[0].c_str());
31 std::string bindir
= args
[0];
32 bindir
+= "_BINARY_DIR";
33 std::string srcdir
= args
[0];
34 srcdir
+= "_SOURCE_DIR";
36 m_Makefile
->AddCacheDefinition(bindir
.c_str(),
37 m_Makefile
->GetCurrentOutputDirectory(),
38 "Value Computed by CMake", cmCacheManager::STATIC
);
39 m_Makefile
->AddCacheDefinition(srcdir
.c_str(),
40 m_Makefile
->GetCurrentDirectory(),
41 "Value Computed by CMake", cmCacheManager::STATIC
);
43 bindir
= "PROJECT_BINARY_DIR";
44 srcdir
= "PROJECT_SOURCE_DIR";
46 m_Makefile
->AddDefinition(bindir
.c_str(),
47 m_Makefile
->GetCurrentOutputDirectory());
48 m_Makefile
->AddDefinition(srcdir
.c_str(),
49 m_Makefile
->GetCurrentDirectory());
51 m_Makefile
->AddDefinition("PROJECT_NAME", args
[0].c_str());
55 for(size_t i
=1; i
< args
.size(); ++i
)
57 m_Makefile
->EnableLanguage(args
[i
].c_str());
62 m_Makefile
->EnableLanguage(0);