Browse Source

Add tools variables for cmake

master
mid-kid 7 years ago
parent
commit
beb58432b7
  1. 5
      satellites/functions/compile/cmake.sh

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

Loading…
Cancel
Save