diff options
author | Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> | 2016-05-04 17:30:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-09 12:56:27 (GMT) |
commit | 8c2cedc6243b281a0814b284abbcd1c45c42b085 (patch) | |
tree | b4bd057053fff493dc9ed8f9538e5e039faa6e89 /Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake | |
parent | eccfc0d185526b746b722ed3d3d1302515698c9e (diff) | |
download | CMake-8c2cedc6243b281a0814b284abbcd1c45c42b085.zip CMake-8c2cedc6243b281a0814b284abbcd1c45c42b085.tar.gz CMake-8c2cedc6243b281a0814b284abbcd1c45c42b085.tar.bz2 |
CustomCommandGenerator: Add support for CROSSCOMPILING_EMULATOR
Teach the `add_custom_command` and `add_custom_target' commands to
substitute argv0 with the crosscompiling emulator if it is a target with
the `CROSSCOMPILING_EMULATOR` property set.
Diffstat (limited to 'Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 2581cfc..71aaad1 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -6,3 +6,18 @@ set(RunCMake_TEST_OPTIONS run_cmake(CrosscompilingEmulatorProperty) run_cmake(TryRun) run_cmake(AddTest) + +function(CustomCommandGenerator_run_and_build case) + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS + "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND}") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(${case}) + run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .) +endfunction() + +CustomCommandGenerator_run_and_build(AddCustomCommand) +CustomCommandGenerator_run_and_build(AddCustomTarget) |