cmEndIfCommand.cxx 714 B

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