-
Notifications
You must be signed in to change notification settings - Fork 39
/
cmake.local
executable file
·44 lines (37 loc) · 1.13 KB
/
cmake.local
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
#
# Configure for a local install. Build files will be generated in the
# directory $toplevel/build and installation will go in the directory
# $toplevel/local.
#
# This is useful to be able to run demos from within the source tree
# without needing to specify an installation directory.
#
# This script is what most developers use to build and rebuild DOLFIN.
# Number of processes to use during build
: ${PROCS:=3}
# Extract any extra argument
CMAKE_EXTRA_ARGS=$@
# Get branch name
BRANCH=`git branch | grep '*' | cut -d' ' -f2 | sed s:/:.:g`
# Set installation and build directory
INSTALLDIR=$PWD/local.$BRANCH
BUILDDIR=$PWD/build.$BRANCH
echo "On branch '$BRANCH'. Build and install in build.$BRANCH, local.$BRANCH."
echo
# Make symlinks to master branch
if [ "$BRANCH" = "master" ]; then
ln -sf $INSTALLDIR local
ln -sf $BUILDDIR build
fi
# Configure
mkdir -p $BUILDDIR
cd $BUILDDIR
cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
-DDOLFIN_ENABLE_TESTING=true \
-DDOLFIN_ENABLE_BENCHMARKS=true \
-DCMAKE_BUILD_TYPE=Developer \
$CMAKE_EXTRA_ARGS \
..
# Build
make -j$PROCS && make install -j$PROCS