summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake')
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
new file mode 100644
index 0000000..22d537c
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
@@ -0,0 +1,28 @@
+# This tests setting the CROSSCOMPILING_EMULATOR target property from the
+# CMAKE_CROSSCOMPILING_EMULATOR variable.
+
+# -DCMAKE_CROSSCOMPILING_EMULATOR=/path/to/pseudo_emulator is passed to this
+# test
+add_executable(target_with_emulator simple_src.cxx)
+get_property(emulator TARGET target_with_emulator
+ PROPERTY CROSSCOMPILING_EMULATOR)
+if(NOT "${emulator}" MATCHES "pseudo_emulator")
+ message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set")
+endif()
+
+set_property(TARGET target_with_emulator
+ PROPERTY CROSSCOMPILING_EMULATOR "another_emulator")
+get_property(emulator TARGET target_with_emulator
+ PROPERTY CROSSCOMPILING_EMULATOR)
+if(NOT "${emulator}" MATCHES "another_emulator")
+ message(SEND_ERROR
+ "set_property/get_property CROSSCOMPILING_EMULATOR is not consistent")
+endif()
+
+unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE)
+add_executable(target_without_emulator simple_src.cxx)
+get_property(emulator TARGET target_without_emulator
+ PROPERTY CROSSCOMPILING_EMULATOR)
+if(NOT "${emulator}" STREQUAL "")
+ message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null")
+endif()