RunCMakeTest.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. include(RunCMake)
  2. set(RunCMake_TEST_OPTIONS
  3. "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}")
  4. run_cmake(CrosscompilingEmulatorProperty)
  5. run_cmake(TryRun)
  6. run_cmake(AddTest)
  7. run_cmake(AddTest-CMP0158-OLD)
  8. run_cmake(AddTest-CMP0158-NEW)
  9. function(CustomCommandGenerator_run_and_build case)
  10. # Use a single build tree for a few tests without cleaning.
  11. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
  12. set(RunCMake_TEST_NO_CLEAN 1)
  13. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  14. file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
  15. run_cmake(${case})
  16. run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .)
  17. endfunction()
  18. set(RunCMake_TEST_OPTIONS
  19. "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND}")
  20. CustomCommandGenerator_run_and_build(AddCustomCommand)
  21. CustomCommandGenerator_run_and_build(AddCustomTarget)
  22. set(RunCMake_TEST_OPTIONS
  23. "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND_ARG}\;custom_argument")
  24. CustomCommandGenerator_run_and_build(AddCustomCommandWithArg)
  25. CustomCommandGenerator_run_and_build(AddCustomTargetWithArg)
  26. unset(RunCMake_TEST_OPTIONS)
  27. function(run_EnvCrossCompilingEmulator)
  28. set(ENV{CMAKE_CROSSCOMPILING_EMULATOR} "${PSEUDO_EMULATOR}")
  29. run_cmake(EnvCrossCompilingEmulator)
  30. unset(ENV{CMAKE_CROSSCOMPILING_EMULATOR})
  31. endfunction()
  32. run_EnvCrossCompilingEmulator()