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