cmSourceFilesRequireRule.cxx 988 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "cmSourceFilesRequireRule.h"
  2. // cmSourceFilesRequireRule
  3. bool cmSourceFilesRequireRule::Invoke(std::vector<std::string>& args)
  4. {
  5. if(args.size() < 3 )
  6. {
  7. this->SetError("called with incorrect number of arguments");
  8. return false;
  9. }
  10. std::vector<std::string>::iterator i = args.begin();
  11. // Search to the key word SOURCES_BEGIN is found
  12. // if one of the required defines is not there, then
  13. // return as none of the source files will be added
  14. // if the required definition is not there.
  15. while(i != args.end() && (*i) != "SOURCES_BEGIN" )
  16. {
  17. if(!m_Makefile->GetDefinition((*i).c_str()))
  18. {
  19. return true;
  20. }
  21. i++;
  22. }
  23. if(i != args.end())
  24. {
  25. i++;
  26. }
  27. // Add the rest of the arguments as source files
  28. for(; i != args.end(); ++i)
  29. {
  30. cmClassFile file;
  31. file.m_AbstractClass = false;
  32. file.SetName((*i).c_str(), m_Makefile->GetCurrentDirectory());
  33. m_Makefile->AddClass(file);
  34. }
  35. return true;
  36. }