aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap-cmake.sh
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2017-10-16 13:47:29 +0200
committerBjørn Christian Seime <bjorncs@oath.com>2017-10-16 17:40:23 +0200
commit3db5ac405d7716d9faefe1c933efbe501fbaea92 (patch)
treec3cc3bfd0e7fedde1cd3525eac59b01c0cf07031 /bootstrap-cmake.sh
parentce7634900d1a9078ca07f78c6186b3e63df3530d (diff)
Split out cmake command into separate bootstrap script
Diffstat (limited to 'bootstrap-cmake.sh')
-rw-r--r--bootstrap-cmake.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/bootstrap-cmake.sh b/bootstrap-cmake.sh
new file mode 100644
index 00000000000..8fe99e47df7
--- /dev/null
+++ b/bootstrap-cmake.sh
@@ -0,0 +1,30 @@
+#!/bin/bash -e
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+usage() {
+ echo "Usage: $0 <source-dir> [<extra-cmake-args>]" >&2
+}
+
+if [[ $# -eq 1 ]]; then
+ SOURCE_DIR=$1
+ EXTRA_CMAKE_ARGS=""
+elif [ $# -eq 2 ]; then
+ SOURCE_DIR=$1
+ EXTRA_CMAKE_ARGS=$2
+elif [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then
+ usage
+ exit 0
+else
+ echo "Wrong number of arguments: expected 1 or 2, was $#" >&2
+ usage
+ exit 1
+fi
+
+cmake3 \
+ -DCMAKE_INSTALL_PREFIX=/opt/vespa \
+ -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
+ -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \
+ -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \
+ -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \
+ ${EXTRA_CMAKE_ARGS} \
+ "${SOURCE_DIR}"