2001-01-11 22:55:47 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-01-11 22:55:47 +03: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-01-11 22:55:47 +03: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-01-11 22:55:47 +03:00
|
|
|
|
|
|
|
=========================================================================*/
|
2001-01-18 19:20:24 +03:00
|
|
|
#include "cmSubdirCommand.h"
|
2001-01-05 19:41:20 +03:00
|
|
|
|
2001-01-18 19:20:24 +03:00
|
|
|
// cmSubdirCommand
|
2002-12-12 02:13:33 +03:00
|
|
|
bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args)
|
2001-01-05 19:41:20 +03:00
|
|
|
{
|
2002-12-12 02:13:33 +03:00
|
|
|
if(args.size() < 1 )
|
2001-01-05 19:41:20 +03:00
|
|
|
{
|
|
|
|
this->SetError("called with incorrect number of arguments");
|
|
|
|
return false;
|
|
|
|
}
|
2002-10-24 18:58:25 +04:00
|
|
|
bool res = true;
|
2004-03-10 00:28:44 +03:00
|
|
|
bool intoplevel = true;
|
2002-03-29 22:20:32 +03:00
|
|
|
|
2001-09-20 23:08:30 +04:00
|
|
|
for(std::vector<std::string>::const_iterator i = args.begin();
|
2001-01-05 19:41:20 +03:00
|
|
|
i != args.end(); ++i)
|
|
|
|
{
|
2004-03-10 00:28:44 +03:00
|
|
|
if(*i == "EXCLUDE_FROM_ALL")
|
|
|
|
{
|
|
|
|
intoplevel = false;
|
|
|
|
continue;
|
|
|
|
}
|
2002-10-24 18:58:25 +04:00
|
|
|
std::string directory = std::string(m_Makefile->GetCurrentDirectory()) +
|
|
|
|
"/" + i->c_str();
|
|
|
|
if ( cmSystemTools::FileIsDirectory(directory.c_str()) )
|
|
|
|
{
|
2004-03-10 00:28:44 +03:00
|
|
|
m_Makefile->AddSubDirectory(i->c_str(), intoplevel);
|
2002-10-24 18:58:25 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::string error = "Incorrect SUBDIRS command. Directory: ";
|
|
|
|
error += directory + " does not exists.";
|
|
|
|
this->SetError(error.c_str());
|
|
|
|
res = false;
|
|
|
|
}
|
2001-01-05 19:41:20 +03:00
|
|
|
}
|
2002-10-24 18:58:25 +04:00
|
|
|
return res;
|
2001-01-05 19:41:20 +03:00
|
|
|
}
|
|
|
|
|