CMake/Source/cmCustomCommand.cxx

83 lines
2.0 KiB
C++
Raw Normal View History

/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
2002-01-21 20:30:43 +00:00
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.
=========================================================================*/
#include "cmCustomCommand.h"
#include "cmMakefile.h"
/**
* The constructor
*/
2003-06-03 14:30:23 +00:00
cmCustomCommand::cmCustomCommand(const char *command,
const char* arguments,
std::vector<std::string> dep,
2003-06-03 14:30:23 +00:00
const char *out):
m_Command(command),
m_Arguments(arguments),
2003-06-03 14:30:23 +00:00
m_Depends(dep)
{
2003-06-03 14:30:23 +00:00
if (out)
{
m_Output = out;
}
}
2003-06-03 14:30:23 +00:00
cmCustomCommand::cmCustomCommand(const char *command,
const char* arguments):
m_Command(command),
m_Arguments(arguments)
{
}
/**
* Copy constructor.
*/
cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
m_Command(r.m_Command),
m_Arguments(r.m_Arguments),
m_Comment(r.m_Comment),
2003-06-03 18:55:20 +00:00
m_Output(r.m_Output),
m_Depends(r.m_Depends)
{
}
void cmCustomCommand::ExpandVariables(const cmMakefile &mf)
{
mf.ExpandVariablesInString(m_Command);
mf.ExpandVariablesInString(m_Arguments);
2003-06-03 14:30:23 +00:00
mf.ExpandVariablesInString(m_Output);
for (std::vector<std::string>::iterator i = m_Depends.begin();
i != m_Depends.end(); ++i)
{
mf.ExpandVariablesInString(*i);
}
}
bool cmCustomCommand::IsEquivalent(const char* command,
const char* args)
{
if(m_Command != command)
{
return false;
}
if(m_Arguments != args)
{
return false;
}
return true;
}