12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include "cmSubdirCommand.h"
- #include "cmMakefile.h"
- #include "cmSystemTools.h"
- class cmExecutionStatus;
- bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
- {
- if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
- return false;
- }
- bool res = true;
- bool excludeFromAll = false;
- for (std::string const& i : args) {
- if (i == "EXCLUDE_FROM_ALL") {
- excludeFromAll = true;
- continue;
- }
- if (i == "PREORDER") {
-
- continue;
- }
-
- std::string srcPath =
- std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + i;
- if (cmSystemTools::FileIsDirectory(srcPath)) {
- std::string binPath =
- std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + i;
- this->Makefile->AddSubDirectory(srcPath, binPath, excludeFromAll, false);
- }
-
- else if (cmSystemTools::FileIsDirectory(i)) {
-
-
- std::string binPath =
- std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" +
- cmSystemTools::GetFilenameName(i);
- this->Makefile->AddSubDirectory(i, binPath, excludeFromAll, false);
- } else {
- std::string error = "Incorrect SUBDIRS command. Directory: ";
- error += i + " does not exist.";
- this->SetError(error);
- res = false;
- }
- }
- return res;
- }
|