cmEndIfCommand.cxx 1.1 KB

1234567891011121314151617181920212223242526272829
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "cmEndIfCommand.h"
  11. #include <stdlib.h> // required for atof
  12. bool cmEndIfCommand::InitialPass(std::vector<std::string> const&,
  13. cmExecutionStatus &)
  14. {
  15. const char* versionValue
  16. = this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
  17. if (!versionValue || (atof(versionValue) <= 1.4))
  18. {
  19. return true;
  20. }
  21. this->SetError("An ENDIF command was found outside of a proper "
  22. "IF ENDIF structure. Or its arguments did not match "
  23. "the opening IF command.");
  24. return false;
  25. }