summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Make
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-16 16:33:58 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-16 16:34:53 (GMT)
commitcfce067b3facbd54275fd323a54e32e161717b8e (patch)
treeab0b64c7051b5589f6a8c3a60b8fb5da99bb9f42 /Tests/RunCMake/Make
parent378c047ae30184bdcefdf767fb49538655ee2191 (diff)
downloadCMake-cfce067b3facbd54275fd323a54e32e161717b8e.zip
CMake-cfce067b3facbd54275fd323a54e32e161717b8e.tar.gz
CMake-cfce067b3facbd54275fd323a54e32e161717b8e.tar.bz2
Tests: Add RunCMake.Make case for conflicting Makefile names
Issue: #21418
Diffstat (limited to 'Tests/RunCMake/Make')
-rw-r--r--Tests/RunCMake/Make/MakefileConflict.cmake5
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake8
2 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/Make/MakefileConflict.cmake b/Tests/RunCMake/Make/MakefileConflict.cmake
new file mode 100644
index 0000000..6a8406f
--- /dev/null
+++ b/Tests/RunCMake/Make/MakefileConflict.cmake
@@ -0,0 +1,5 @@
+add_custom_target(Custom)
+
+# Write a file that GNU make will prefer over "Makefile"
+# if 'cmake --build' does not explicitly specify it.
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile" "")
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 5562aca..b66e30e 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -42,6 +42,14 @@ run_VerboseBuild()
run_cmake(CustomCommandDepfile-ERROR)
run_cmake(IncludeRegexSubdir)
+function(run_MakefileConflict)
+ run_cmake(MakefileConflict)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MakefileConflict-build)
+ run_cmake_command(MakefileConflict-build ${CMAKE_COMMAND} --build . --target Custom)
+endfunction()
+run_MakefileConflict()
+
function(run_CMP0113 val)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0113-${val}-build)
run_cmake(CMP0113-${val})