cmUnexpectedCommand.cxx 633 B

12345678910111213141516171819202122
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmUnexpectedCommand.h"
  4. #include <stdlib.h>
  5. #include "cmMakefile.h"
  6. class cmExecutionStatus;
  7. bool cmUnexpectedCommand::InitialPass(std::vector<std::string> const&,
  8. cmExecutionStatus&)
  9. {
  10. const char* versionValue =
  11. this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
  12. if (this->Name == "endif" && (!versionValue || atof(versionValue) <= 1.4)) {
  13. return true;
  14. }
  15. this->SetError(this->Error);
  16. return false;
  17. }