cmAddExecutableCommand.cxx 1.37 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
35
36
37
38
  ++s;
  if (*s == "WIN32")
    {
    ++s;
    std::vector<std::string> srclists(s, args.end());
39
    m_Makefile->AddExecutable(exename.c_str(),srclists, true); 
40
41
42
43
    }
  else
    {
    std::vector<std::string> srclists(s, args.end());
44
    m_Makefile->AddExecutable(exename.c_str(),srclists, false); 
45
    }
46
47
48
49
  
  return true;
}