1
/*=========================================================================
3
Program: CMake - Cross-Platform Makefile Generator
4
Module: $RCSfile: cmIncludeExternalMSProjectCommand.cxx,v $
6
Date: $Date: 2008-01-28 13:38:35 $
7
Version: $Revision: 1.23 $
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
=========================================================================*/
1
/*============================================================================
2
CMake - Cross Platform Makefile Generator
3
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5
Distributed under the OSI-approved BSD License (the "License");
6
see accompanying file Copyright.txt for details.
8
This software is distributed WITHOUT ANY WARRANTY; without even the
9
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
See the License for more information.
11
============================================================================*/
17
12
#include "cmIncludeExternalMSProjectCommand.h"
19
14
// cmIncludeExternalMSProjectCommand
31
26
if(this->Makefile->GetDefinition("WIN32"))
33
std::string location = args[1];
35
std::vector<std::string> depends;
38
for (unsigned int i=2; i<args.size(); ++i)
40
depends.push_back(args[i]);
44
// Hack together a utility target storing enough information
45
// to reproduce the target inclusion.
46
std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
48
utility_name += args[0];
49
28
std::string path = args[1];
50
29
cmSystemTools::ConvertToUnixSlashes(path);
52
31
// Create a target instance for this utility.
53
32
cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
54
utility_name.c_str());
55
target->SetProperty("EXCLUDE_FROM_ALL","FALSE");
56
std::vector<std::string> no_outputs;
57
cmCustomCommandLines commandLines;
58
cmCustomCommandLine commandLine;
59
commandLine.push_back(args[0]);
60
commandLine.push_back(path);
61
commandLines.push_back(commandLine);
62
cmCustomCommand cc(no_outputs, depends, commandLines, 0, 0);
63
target->GetPostBuildCommands().push_back(cc);
34
target->SetProperty("EXTERNAL_MSPROJECT", path.c_str());
35
target->SetProperty("EXCLUDE_FROM_ALL","FALSE");
36
target->SetProperty("GENERATOR_FILE_NAME", args[0].c_str());
37
for (unsigned int i=2; i<args.size(); ++i)
39
target->AddUtility(args[i].c_str());