summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/NinjaMultiConfig
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-03-02 19:57:17 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-03-02 20:10:53 (GMT)
commitdf38eaab2c806d15a3b2039bf96ad3e69569b5e8 (patch)
treea42128730d8dc88d90721cf88b9c5f25852b3cc4 /Tests/RunCMake/NinjaMultiConfig
parent9f309e655fe87b8d2193c8e719a8748ad3e3c382 (diff)
downloadCMake-df38eaab2c806d15a3b2039bf96ad3e69569b5e8.zip
CMake-df38eaab2c806d15a3b2039bf96ad3e69569b5e8.tar.gz
CMake-df38eaab2c806d15a3b2039bf96ad3e69569b5e8.tar.bz2
Ninja Multi-Config: Write output path prefix
Fixes: #24566
Diffstat (limited to 'Tests/RunCMake/NinjaMultiConfig')
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix-all-ninja-stdout.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake9
3 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix-all-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix-all-ninja-stdout.txt
new file mode 100644
index 0000000..f5bce43
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix-all-ninja-stdout.txt
@@ -0,0 +1 @@
+tgt has been built
diff --git a/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix.cmake b/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix.cmake
new file mode 100644
index 0000000..c4e0587
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/OutputPathPrefix.cmake
@@ -0,0 +1 @@
+add_custom_target(tgt ALL COMMAND ${CMAKE_COMMAND} -E echo "tgt has been built")
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index c040e8f..47f5eee 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -459,6 +459,15 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_C
run_cmake(CompileCommands)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/OutputPathPrefix-build)
+run_cmake_with_options(OutputPathPrefix "-DCMAKE_NINJA_OUTPUT_PATH_PREFIX=OutputPathPrefix-build")
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR})
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_command(OutputPathPrefix-all-ninja "${RunCMake_MAKE_PROGRAM}" -f OutputPathPrefix-build/build.ninja OutputPathPrefix-build/all)
+run_cmake_command(OutputPathPrefix-clean-ninja "${RunCMake_MAKE_PROGRAM}" -f OutputPathPrefix-build/build.ninja OutputPathPrefix-build/clean)
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
# CudaSimple uses separable compilation, which is currently only supported on NVCC.
if(CMake_TEST_CUDA)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CudaSimple-build)