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