RunCMakeTest.cmake 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. include(RunCMake)
  2. if(RunCMake_GENERATOR STREQUAL "Xcode")
  3. run_cmake(ConfigNotAllowed)
  4. endif()
  5. run_cmake(EmptyKeywordArgs)
  6. run_cmake(OriginDebug)
  7. run_cmake(CMP0026-LOCATION)
  8. run_cmake(CMP0076-OLD)
  9. run_cmake(CMP0076-WARN)
  10. run_cmake(RelativePathInInterface)
  11. run_cmake(RelativePathInSubdirGenEx)
  12. run_cmake(RelativePathInSubdirInterface)
  13. run_cmake(RelativePathInSubdirPrivate)
  14. run_cmake(RelativePathInSubdirInclude)
  15. run_cmake(ExportBuild)
  16. run_cmake(AddCustomTargetPublicSources)
  17. run_cmake(AddCustomTargetPrivateSources)
  18. run_cmake(AddCustomTargetInterfaceSources)
  19. run_cmake(AddCustomTargetSources)
  20. run_cmake(AddCustomTargetCheckProperty)
  21. run_cmake(AddCustomTargetGenx)
  22. run_cmake(FileSetProperties)
  23. run_cmake(FileSetNoType)
  24. run_cmake(FileSetWrongType)
  25. run_cmake(FileSetDefaultWrongType)
  26. run_cmake(FileSetChangeScope)
  27. run_cmake(FileSetChangeType)
  28. run_cmake(FileSetWrongBaseDirs)
  29. run_cmake(FileSetWrongBaseDirsRelative)
  30. run_cmake(FileSetOverlappingBaseDirs)
  31. run_cmake(FileSetInstallMissingSetsPrivate)
  32. run_cmake(FileSetInstallMissingSetsInterface)
  33. run_cmake(FileSetReadOnlyPrivate)
  34. run_cmake(FileSetReadOnlyInterface)
  35. run_cmake(FileSetNoExistInstall)
  36. run_cmake(FileSetDirectories)
  37. run_cmake(FileSetCustomTarget)
  38. run_cmake(FileSetBadName)
  39. if(APPLE)
  40. run_cmake(FileSetFramework)
  41. endif()
  42. set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=NEW)
  43. run_cmake(FileSetFileNoExist)
  44. unset(RunCMake_TEST_OPTIONS)
  45. function(run_export_import name)
  46. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  47. set(_config_options "-DCMAKE_CONFIGURATION_TYPES=Debug\\\\;Release")
  48. else()
  49. set(_config_options -DCMAKE_BUILD_TYPE=Debug)
  50. endif()
  51. set(RunCMake_TEST_NO_CLEAN 1)
  52. set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}Export-build")
  53. set(RunCMake_TEST_OPTIONS "--install-prefix=${RunCMake_TEST_BINARY_DIR}/install" ${_config_options})
  54. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  55. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  56. run_cmake(${name}Export)
  57. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --build . --config Debug)
  58. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --install . --config Debug)
  59. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  60. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --build . --config Release)
  61. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --install . --config Release)
  62. endif()
  63. unset(RunCMake_TEST_OPTIONS)
  64. set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}Import-build")
  65. unset(RunCMake_TEST_OPTIONS)
  66. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  67. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  68. run_cmake(${name}Import)
  69. run_cmake_command(${name}Import-build ${CMAKE_COMMAND} --build . --config Debug)
  70. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  71. run_cmake_command(${name}Import-build ${CMAKE_COMMAND} --build . --config Release)
  72. endif()
  73. unset(RunCMake_TEST_BINARY_DIR)
  74. unset(RunCMake_TEST_NO_CLEAN)
  75. endfunction()
  76. run_export_import(FileSet)