Updated formatting of documentation plus a little reorganization.
[cmake.git] / Source / cmIncludeExternalMSProjectCommand.cxx
blob3cc8aeeb785d4d1ce369af490b9bc35c3747833d
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmIncludeExternalMSProjectCommand.cxx,v $
5 Language: C++
6 Date: $Date: 2009-07-14 20:06:58 $
7 Version: $Revision: 1.25 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 "cmIncludeExternalMSProjectCommand.h"
19 // cmIncludeExternalMSProjectCommand
20 bool cmIncludeExternalMSProjectCommand
21 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
23 if(args.size() < 2)
25 this->SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect "
26 "number of arguments");
27 return false;
29 // only compile this for win32 to avoid coverage errors
30 #ifdef _WIN32
31 if(this->Makefile->GetDefinition("WIN32"))
33 std::string path = args[1];
34 cmSystemTools::ConvertToUnixSlashes(path);
36 // Create a target instance for this utility.
37 cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
38 args[0].c_str());
39 target->SetProperty("EXTERNAL_MSPROJECT", path.c_str());
40 target->SetProperty("EXCLUDE_FROM_ALL","FALSE");
41 target->SetProperty("GENERATOR_FILE_NAME", args[0].c_str());
42 for (unsigned int i=2; i<args.size(); ++i)
44 target->AddUtility(args[i].c_str());
47 #endif
48 return true;