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/CMakeLists.txt | |
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/CMakeLists.txt')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 02e14e6..d16e5e7 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -289,8 +289,10 @@ if(CMake_TEST_FindMatlab) endif() add_executable(pseudo_emulator pseudo_emulator.c) +add_executable(pseudo_emulator_custom_command pseudo_emulator_custom_command.c) add_RunCMake_test(CrosscompilingEmulator - -DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator>) + -DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator> + -DPSEUDO_EMULATOR_CUSTOM_COMMAND=$<TARGET_FILE:pseudo_emulator_custom_command>) # Xcode 2.x forgets to create the output directory before linking # the individual architectures. if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") @@ -298,6 +300,10 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]" TARGET pseudo_emulator PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" ) + add_custom_command( + TARGET pseudo_emulator_custom_command + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) endif() if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") |