RunCMakeTest.cmake 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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(FileSetNoScope)
  34. run_cmake(FileSetNoExistPrivate)
  35. run_cmake(FileSetNoExistInterface)
  36. run_cmake(FileSetNoExistInstall)
  37. run_cmake(FileSetDirectories)
  38. run_cmake(FileSetCustomTarget)
  39. run_cmake(FileSetBadName)
  40. set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=NEW)
  41. run_cmake(FileSetFileNoExist)
  42. unset(RunCMake_TEST_OPTIONS)
  43. function(run_export_import name)
  44. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  45. set(_config_options "-DCMAKE_CONFIGURATION_TYPES=Debug\\\\;Release")
  46. else()
  47. set(_config_options -DCMAKE_BUILD_TYPE=Debug)
  48. endif()
  49. set(RunCMake_TEST_NO_CLEAN 1)
  50. set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}Export-build")
  51. set(RunCMake_TEST_OPTIONS "--install-prefix=${RunCMake_TEST_BINARY_DIR}/install" ${_config_options})
  52. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  53. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  54. run_cmake(${name}Export)
  55. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --build . --config Debug)
  56. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --install . --config Debug)
  57. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  58. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --build . --config Release)
  59. run_cmake_command(${name}Export-build ${CMAKE_COMMAND} --install . --config Release)
  60. endif()
  61. unset(RunCMake_TEST_OPTIONS)
  62. set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}Import-build")
  63. unset(RunCMake_TEST_OPTIONS)
  64. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  65. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  66. run_cmake(${name}Import)
  67. run_cmake_command(${name}Import-build ${CMAKE_COMMAND} --build . --config Debug)
  68. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  69. run_cmake_command(${name}Import-build ${CMAKE_COMMAND} --build . --config Release)
  70. endif()
  71. unset(RunCMake_TEST_BINARY_DIR)
  72. unset(RunCMake_TEST_NO_CLEAN)
  73. endfunction()
  74. run_export_import(FileSet)