CMP0054-policy-nested-if.cmake 929 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. set(FOO BAR)
  2. cmake_policy(SET CMP0054 NEW)
  3. if("FOO" STREQUAL BAR)
  4. message(FATAL_ERROR "The strings should not match")
  5. if("FOO" STREQUAL BAR)
  6. message(FATAL_ERROR "The strings should not match")
  7. endif()
  8. cmake_policy(SET CMP0054 OLD)
  9. if(NOT "FOO" STREQUAL BAR)
  10. message(FATAL_ERROR "The quoted variable should match the string")
  11. endif()
  12. endif()
  13. if("FOO" STREQUAL BAR)
  14. message(FATAL_ERROR "The strings should not match")
  15. endif()
  16. cmake_policy(SET CMP0054 OLD)
  17. if(NOT "FOO" STREQUAL BAR)
  18. message(FATAL_ERROR "The quoted variable should match the string")
  19. if(NOT "FOO" STREQUAL BAR)
  20. message(FATAL_ERROR "The quoted variable should match the string")
  21. endif()
  22. cmake_policy(SET CMP0054 NEW)
  23. if("FOO" STREQUAL BAR)
  24. message(FATAL_ERROR "The strings should not match")
  25. endif()
  26. endif()
  27. if(NOT "FOO" STREQUAL BAR)
  28. message(FATAL_ERROR "The quoted variable should match the string")
  29. endif()