summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/UseSWIG/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/UseSWIG/RunCMakeTest.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
new file mode 100644
index 000000000..6acf7199c
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
@@ -0,0 +1,25 @@
+include(RunCMake)
+
+run_cmake(CMP0078-WARN)
+run_cmake(CMP0078-OLD)
+run_cmake(CMP0078-NEW)
+
+run_cmake(CMP0086-WARN)
+
+if (CMake_TEST_FindPython)
+
+ macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ endmacro()
+
+ run_cmake(CMP0086-OLD)
+ run_cmake_target(CMP0086-OLD build example)
+ run_cmake(CMP0086-NEW)
+ run_cmake_target(CMP0086-NEW build example)
+
+endif()