RunCMakeTest.cmake 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. include(RunCMake)
  2. run_cmake(CMP0074-WARN)
  3. run_cmake(CMP0074-OLD)
  4. run_cmake(ComponentRequiredAndOptional)
  5. run_cmake(FromPATHEnv)
  6. run_cmake_with_options(FromPATHEnvDebugPkg --debug-find-pkg=Resolved)
  7. run_cmake(FromPrefixPath)
  8. run_cmake(GlobalImportTarget)
  9. run_cmake(MissingNormal)
  10. run_cmake(MissingNormalForceRequired)
  11. run_cmake(MissingNormalRequired)
  12. run_cmake(MissingNormalVersion)
  13. run_cmake(MissingNormalWarnNoModuleOld)
  14. run_cmake(MissingNormalWarnNoModuleNew)
  15. run_cmake(MissingModule)
  16. run_cmake(MissingModuleRequired)
  17. run_cmake(MissingConfig)
  18. run_cmake(MissingConfigDebug)
  19. run_cmake_with_options(MissingConfigDebugPkg --debug-find-pkg=NotHere)
  20. run_cmake(MissingConfigOneName)
  21. run_cmake(MissingConfigRequired)
  22. run_cmake(MissingConfigVersion)
  23. run_cmake(MixedModeOptions)
  24. run_cmake_with_options(ModuleModeDebugPkg --debug-find-pkg=Foo,Zot)
  25. run_cmake(PackageRoot)
  26. run_cmake(PackageRootNestedConfig)
  27. run_cmake(PackageRootNestedModule)
  28. run_cmake(PolicyPush)
  29. run_cmake(PolicyPop)
  30. run_cmake(RequiredOptionValuesClash)
  31. run_cmake(FindRootPathAndPrefixPathAreEqual)
  32. run_cmake(SetFoundFALSE)
  33. run_cmake(WrongVersion)
  34. run_cmake(WrongVersionConfig)
  35. run_cmake(CMP0084-OLD)
  36. run_cmake(CMP0084-WARN)
  37. run_cmake(CMP0084-NEW)
  38. run_cmake(WrongVersionRange)
  39. run_cmake(EmptyVersionRange)
  40. run_cmake(VersionRangeWithEXACT)
  41. run_cmake(VersionRange)
  42. run_cmake(VersionRange2)
  43. run_cmake(VersionRange3)
  44. run_cmake(VersionRange4)
  45. run_cmake(VersionRangeConfig)
  46. run_cmake(VersionRangeConfig2)
  47. run_cmake(VersionRangeConfig02)
  48. run_cmake(VersionRangeConfigStd)
  49. run_cmake(VersionRangeConfigStd2)
  50. run_cmake_with_options(IgnoreInstallPrefix "-DCMAKE_INSTALL_PREFIX=${RunCMake_SOURCE_DIR}/PackageRoot/foo/cmake_root")
  51. run_cmake(IgnorePath)
  52. run_cmake(IgnorePrefixPath)
  53. run_cmake(REGISTRY_VIEW-no-view)
  54. run_cmake(REGISTRY_VIEW-wrong-view)
  55. run_cmake(REGISTRY_VIEW-propagated)
  56. if(UNIX
  57. AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
  58. )
  59. run_cmake(SetFoundResolved)
  60. endif()
  61. if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
  62. # Tests using the Windows registry
  63. find_program(REG NAMES "reg.exe" NO_CACHE)
  64. if (REG)
  65. ## check host architecture
  66. cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "HKCU" SUBKEYS VIEW 64 ERROR_VARIABLE status)
  67. if (status STREQUAL "")
  68. set(ARCH "64bit")
  69. else()
  70. set(ARCH "32bit")
  71. endif()
  72. # crete some entries in the registry
  73. cmake_path(CONVERT "${RunCMake_SOURCE_DIR}/registry_host${ARCH}.reg" TO_NATIVE_PATH_LIST registry_data)
  74. execute_process(COMMAND "${REG}" import "${registry_data}" OUTPUT_QUIET ERROR_QUIET)
  75. run_cmake_with_options(Registry-query -DARCH=${ARCH})
  76. # clean-up registry
  77. execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\CLSID\\CMake-Tests\\find_package" /f OUTPUT_QUIET ERROR_QUIET)
  78. if (ARCH STREQUAL "64bit")
  79. execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\WOW6432Node\\CLSID\\CMake-Tests\\find_package" /f OUTPUT_QUIET ERROR_QUIET)
  80. endif()
  81. endif()
  82. endif()