-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·25 lines (25 loc) · 901 Bytes
/
configure
File metadata and controls
executable file
·25 lines (25 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
PATH="$PATH:/Applications/CMake.app/Contents/bin"
cmake --version || brew install cmake
if ! cmake --version >/dev/null; then
echo 'Please install CMake to build this package.'
echo 'The easiest way is to use Homebrew (https://brew.sh/):'
echo ' brew install cmake'
echo 'Otherwise, use an installer available at https://cmake.org/download/'
exit 1
fi
unset LDFLAGS
echo "CC CFLAGS: $CC $CFLAGS"
echo "CXX CXXFLAGS: $CXX $CXXFLAGS"
echo "PWD: $PWD"
echo "R_LIBRARY_DIR: $R_LIBRARY_DIR"
echo "R_PACKAGE_DIR: $R_PACKAGE_DIR"
BUILD_DIR="${R_SESSION_TMPDIR}/${R_PACKAGE_NAME}-build"
if [ -n "$DEVTOOLS_LOAD" ] && [ ! -f "build/compile_commands.json" ]; then
BUILD_DIR="build"
fi
echo "BUILD_DIR: $BUILD_DIR"
rm -r "${BUILD_DIR}"/CMake*
cmake -S src -B "$BUILD_DIR" -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/CMakeInstallPrefix"
cmake --build "$BUILD_DIR" -j3
cmake --install "$BUILD_DIR"