~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Source/cmIncludeExternalMSProjectCommand.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=========================================================================
2
 
 
3
 
  Program:   CMake - Cross-Platform Makefile Generator
4
 
  Module:    $RCSfile: cmIncludeExternalMSProjectCommand.cxx,v $
5
 
  Language:  C++
6
 
  Date:      $Date: 2008-01-28 13:38:35 $
7
 
  Version:   $Revision: 1.23 $
8
 
 
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.
11
 
 
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.
15
 
 
16
 
=========================================================================*/
 
1
/*============================================================================
 
2
  CMake - Cross Platform Makefile Generator
 
3
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
 
4
 
 
5
  Distributed under the OSI-approved BSD License (the "License");
 
6
  see accompanying file Copyright.txt for details.
 
7
 
 
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"
18
13
 
19
14
// cmIncludeExternalMSProjectCommand
30
25
#ifdef _WIN32
31
26
  if(this->Makefile->GetDefinition("WIN32"))
32
27
    {
33
 
    std::string location = args[1];
34
 
    
35
 
    std::vector<std::string> depends;
36
 
    if (args.size() > 2)
37
 
      {
38
 
      for (unsigned int i=2; i<args.size(); ++i) 
39
 
        {
40
 
        depends.push_back(args[i]); 
41
 
        }
42
 
      }
43
 
 
44
 
    // Hack together a utility target storing enough information
45
 
    // to reproduce the target inclusion.
46
 
    std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
47
 
    utility_name += "_";
48
 
    utility_name += args[0];
49
28
    std::string path = args[1];
50
29
    cmSystemTools::ConvertToUnixSlashes(path);
51
30
 
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);
 
33
                                                  args[0].c_str());
 
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) 
 
38
      {
 
39
      target->AddUtility(args[i].c_str());
 
40
      }
64
41
    }
65
42
#endif
66
43
  return true;