2001-01-11 22:55:47 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: Insight Segmentation & Registration Toolkit
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2000 National Library of Medicine
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
See COPYRIGHT.txt for copyright details.
|
|
|
|
|
|
|
|
=========================================================================*/
|
2001-01-18 19:20:24 +03:00
|
|
|
#include "cmSourceFilesRequireCommand.h"
|
2001-01-05 19:41:20 +03:00
|
|
|
|
2001-01-18 19:20:24 +03:00
|
|
|
// cmSourceFilesRequireCommand
|
|
|
|
bool cmSourceFilesRequireCommand::Invoke(std::vector<std::string>& args)
|
2001-01-05 19:41:20 +03:00
|
|
|
{
|
2001-04-11 22:59:02 +04:00
|
|
|
if(args.size() < 4 )
|
2001-01-05 19:41:20 +03:00
|
|
|
{
|
|
|
|
this->SetError("called with incorrect number of arguments");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
std::vector<std::string>::iterator i = args.begin();
|
|
|
|
// Search to the key word SOURCES_BEGIN is found
|
|
|
|
// if one of the required defines is not there, then
|
|
|
|
// return as none of the source files will be added
|
|
|
|
// if the required definition is not there.
|
|
|
|
while(i != args.end() && (*i) != "SOURCES_BEGIN" )
|
|
|
|
{
|
|
|
|
if(!m_Makefile->GetDefinition((*i).c_str()))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if(i != args.end())
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add the rest of the arguments as source files
|
2001-04-11 22:59:02 +04:00
|
|
|
const char *sname = (*i).c_str();
|
|
|
|
++i;
|
2001-01-05 19:41:20 +03:00
|
|
|
for(; i != args.end(); ++i)
|
|
|
|
{
|
|
|
|
cmClassFile file;
|
|
|
|
file.m_AbstractClass = false;
|
|
|
|
file.SetName((*i).c_str(), m_Makefile->GetCurrentDirectory());
|
2001-04-11 22:59:02 +04:00
|
|
|
m_Makefile->AddClass(file, sname);
|
2001-01-05 19:41:20 +03:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|