cmAddExecutableCommand.cxx 1.43 KB
Newer Older
1
2
3
4
5
6
7
8
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile$
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

Will Schroeder's avatar
Will Schroeder committed
9
10
  Copyright (c) 2002 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11

Will Schroeder's avatar
Will Schroeder committed
12
13
14
     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.
15
16
17

=========================================================================*/
#include "cmAddExecutableCommand.h"
18
#include "cmCacheManager.h"
19
20

// cmExecutableCommand
21
bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
22
23
24
25
26
27
{
  if(args.size() < 2 )
    {
    this->SetError("called with incorrect number of arguments");
    return false;
    }
28

29
  std::vector<std::string>::const_iterator s = args.begin();
30
31
32
33

  std::string exename = *s;
  m_Makefile->ExpandVariablesInString(exename);

34
  ++s;
35
36
  bool use_win32 = false;

37
38
39
  if (*s == "WIN32")
    {
    ++s;
40
    use_win32 = true;
41
    }
42
43
44
45

  std::vector<std::string> srclists(s, args.end());
  for(std::vector<std::string>::iterator j = srclists.begin();
      j != srclists.end(); ++j)
46
    {
47
    m_Makefile->ExpandVariablesInString(*j);
48
    }
49
50

  m_Makefile->AddExecutable(exename.c_str(), srclists, use_win32); 
51
52
53
54
  
  return true;
}