Skip to content
Snippets Groups Projects
Commit c0619861 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'cmake-build-specify-makefile-name'


cfce067b Tests: Add RunCMake.Make case for conflicting Makefile names
378c047a Makefiles: Explicitly tell 'make' tool what Makefile name to use

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5509
parents 0b47e940 cfce067b
No related branches found
No related tags found
No related merge requests found
......@@ -589,6 +589,11 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
}
makeCommand.Add(this->SelectMakeProgram(makeProgram));
// Explicitly tell the make tool to use the Makefile written by
// cmLocalUnixMakefileGenerator3::WriteLocalMakefile
makeCommand.Add("-f");
makeCommand.Add("Makefile");
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
makeCommand.Add("-j");
......
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" "")
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment