RunCMakeTest.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. include(RunCMake)
  2. # Use an initial cache file to define the project() variables
  3. # to avoid long command lines. Also see the CMakeOnly test case
  4. # which tests some of the individual variables one at a time.
  5. # Here, we are focused on testing that the variables are all injected
  6. # at the expected points in the expected order.
  7. run_cmake_with_options(CodeInjection1
  8. -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_1.cmake"
  9. )
  10. # This checks that List variables are allowed.
  11. run_cmake_with_options(CodeInjection2
  12. -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_2.cmake"
  13. )
  14. # This checks that module names are also allowed.
  15. run_cmake_with_options(CodeInjection3
  16. -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_3.cmake"
  17. )
  18. if(CMake_TEST_RESOURCES)
  19. run_cmake(ExplicitRC)
  20. endif()
  21. set(RunCMake_DEFAULT_stderr .)
  22. run_cmake(LanguagesDuplicate)
  23. unset(RunCMake_DEFAULT_stderr)
  24. run_cmake(LanguagesImplicit)
  25. run_cmake(LanguagesEmpty)
  26. run_cmake(LanguagesNONE)
  27. run_cmake(LanguagesTwice)
  28. run_cmake(LanguagesUnordered)
  29. if(RunCMake_GENERATOR MATCHES "Make|Ninja")
  30. run_cmake(LanguagesUsedButNotEnabled)
  31. endif()
  32. run_cmake(ProjectCMP0126)
  33. run_cmake(ProjectDescription)
  34. run_cmake(ProjectDescription2)
  35. run_cmake(ProjectDescriptionNoArg)
  36. run_cmake(ProjectDescriptionNoArg2)
  37. run_cmake(ProjectHomepage)
  38. run_cmake(ProjectHomepage2)
  39. run_cmake(ProjectHomepageNoArg)
  40. run_cmake(ProjectIsTopLevel)
  41. run_cmake(ProjectIsTopLevelMultiple)
  42. run_cmake(ProjectIsTopLevelSubdirectory)
  43. run_cmake(ProjectTwice)
  44. run_cmake(VersionAndLanguagesEmpty)
  45. run_cmake(VersionEmpty)
  46. run_cmake(VersionInvalid)
  47. run_cmake(VersionMissingLanguages)
  48. run_cmake(VersionMissingValueOkay)
  49. run_cmake(VersionTwice)
  50. run_cmake(VersionMax)
  51. run_cmake(CMP0048-OLD)
  52. run_cmake(CMP0048-OLD-VERSION)
  53. run_cmake(CMP0048-WARN)
  54. run_cmake(CMP0048-NEW)
  55. run_cmake(CMP0096-WARN)
  56. run_cmake(CMP0096-OLD)
  57. run_cmake(CMP0096-NEW)
  58. run_cmake(NoMinimumRequired)