summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/target_link_directories/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/target_link_directories/RunCMakeTest.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
index b67c598..a74ee25 100644
--- a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
@@ -1,3 +1,33 @@
include(RunCMake)
+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(empty_keyword_args)
+
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND
+ NOT RunCMake_GENERATOR MATCHES "(NMake|Borland)")
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+ if (RunCMake_GENERATOR MATCHES "Ninja")
+ set(VERBOSE -- -v)
+ endif()
+
+ run_cmake(CMP0099-NEW)
+ run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE})
+
+
+ run_cmake(CMP0099-OLD)
+ run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE})
+
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+endif()