cmEndIfCommand.cxx 766 B

123456789101112131415161718192021222324
  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 "cmEndIfCommand.h"
  4. #include <stdlib.h> // required for atof
  5. #include "cmMakefile.h"
  6. class cmExecutionStatus;
  7. bool cmEndIfCommand::InitialPass(std::vector<std::string> const&,
  8. cmExecutionStatus&)
  9. {
  10. const char* versionValue =
  11. this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
  12. if (!versionValue || (atof(versionValue) <= 1.4)) {
  13. return true;
  14. }
  15. this->SetError("An ENDIF command was found outside of a proper "
  16. "IF ENDIF structure. Or its arguments did not match "
  17. "the opening IF command.");
  18. return false;
  19. }