diff options
author | Eric Sandall | 2016-03-11 10:15:01 -0800 |
---|---|---|
committer | Eric Sandall | 2016-03-11 10:17:59 -0800 |
commit | fac5120650c12c1522f87b0bcd63890175357fc8 (patch) | |
tree | 3252fc1f590368b34f2a3f5fac3d647640261344 /CMAKE_CONFIGURE | |
parent | b209e65289ed1cfa2dd8f79e26e0d272b84d5952 (diff) |
CMAKE_CONFIGURE: Default to "Unix Makefiles" for CMAKE_GEN
Error without ninja installed:
CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
Override CMAKE_GEN based on status of the ninja package. Since we make
this persistent (for subsequent files such as BUILD to see CMAKE_GEN) if
we accept a pre-defined value, then once we've cast with or without
ninja, forever will this dominate our destiny. Or something.
Diffstat (limited to 'CMAKE_CONFIGURE')
-rwxr-xr-x | CMAKE_CONFIGURE | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMAKE_CONFIGURE b/CMAKE_CONFIGURE index 5bc94a1523..f330ece5f0 100755 --- a/CMAKE_CONFIGURE +++ b/CMAKE_CONFIGURE @@ -2,5 +2,14 @@ config_query_list CM_BUILD_TYPE 'which build type?' Release Debug RelWithDebIn #if is_depends_enabled $SPELL extra-cmake-modules;then config_query_option CM_TESTS 'build tests?' n "-DBUILD_TESTING=1" "-DBUILD_TESTING=0" #fi -CMAKE_GEN=${CMAKE_GEN:-Ninja} + +# Default to Ninja cmake generator if it's installed, otherwise the standard Unix way +if spell_ok ninja; then + message "${MESSAGE_COLOR}${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}${MESSAGE_COLOR} is using ${SPELL_COLOR}ninja${DEFAULT_COLOR}${MESSAGE_COLOR} for CMAKE GENERATOR." && + CMAKE_GEN='Ninja' +else + message "${MESSAGE_COLOR}${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}${MESSAGE_COLOR} is using \"Unix Makefiles\" for CMAKE GENERATOR." && + CMAKE_GEN='Unix Makefiles' +fi && + persistent_add CMAKE_GEN |