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" \