summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-11-26 16:13:02 (GMT)
committerBrad King <brad.king@kitware.com>2019-11-26 16:20:15 (GMT)
commitfeb5cb8d9d9a334c34e8cc30c9970fd5d71d25fd (patch)
tree49d6a08ff9c7743217a1f061dad35f16b6496a40
parentffe801062a63387b2c109eda034d74830d72a4ce (diff)
downloadCMake-feb5cb8d9d9a334c34e8cc30c9970fd5d71d25fd.zip
CMake-feb5cb8d9d9a334c34e8cc30c9970fd5d71d25fd.tar.gz
CMake-feb5cb8d9d9a334c34e8cc30c9970fd5d71d25fd.tar.bz2
Ninja: Prefer first ninja tool available in PATH
We search for tools `ninja-build`, `ninja`, and `samu` as the build tool for the Ninja generator. Re-order the search to prefer whichever tool appears first in the `PATH`. This makes it easier for users to control which tool gets used when more than one is available. Fixes: #20028
-rw-r--r--Help/release/dev/ninja-tool.rst7
-rw-r--r--Modules/CMakeNinjaFindMake.cmake1
2 files changed, 8 insertions, 0 deletions
diff --git a/Help/release/dev/ninja-tool.rst b/Help/release/dev/ninja-tool.rst
new file mode 100644
index 0000000..aa0292e
--- /dev/null
+++ b/Help/release/dev/ninja-tool.rst
@@ -0,0 +1,7 @@
+ninja-tool
+----------
+
+* The :generator:`Ninja` generator now prefers the first ninja build
+ tool to appear in the ``PATH`` no matter whether it is called
+ ``ninja-build``, ``ninja``, or ``samu``. Previously the first
+ of those names to appear anywhere in the ``PATH`` would be preferred.
diff --git a/Modules/CMakeNinjaFindMake.cmake b/Modules/CMakeNinjaFindMake.cmake
index 702af13..32f78da 100644
--- a/Modules/CMakeNinjaFindMake.cmake
+++ b/Modules/CMakeNinjaFindMake.cmake
@@ -4,5 +4,6 @@
find_program(CMAKE_MAKE_PROGRAM
NAMES ninja-build ninja samu
+ NAMES_PER_DIR
DOC "Program used to build from build.ninja files.")
mark_as_advanced(CMAKE_MAKE_PROGRAM)