From beb58432b7efd4b320bf9095ed5a92abf8e8eadb Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 8 Nov 2017 15:38:25 +0100 Subject: [PATCH] Add tools variables for cmake --- satellites/functions/compile/cmake.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index f1d2e6f..003206b 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -13,7 +13,7 @@ compile_cmake() { [ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true local generator='Unix Makefiles' - if command -v ninja 2> /dev/null; then + if command -v ninja > /dev/null 2> /dev/null; then local generator='Ninja' fi @@ -25,6 +25,9 @@ compile_cmake() { # https://github.com/Kitware/CMake/blob/master/Modules/GNUInstallDirs.cmake mkdir -p "$builddir"; cd "$builddir" cmake "$olddir" -G "$generator" \ + -DCMAKE_AR="$(command -v ${AR:-ar})" \ + -DCMAKE_NM="$(command -v ${NM:-nm})" \ + -DCMAKE_RANLIB="$(command -v ${RANLIB:-ranlib})" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/$dir_prefix" \ -DCMAKE_INSTALL_FULL_BINDIR="/$dir_prefix/$dir_bin" \