Reduce duplication in cmake command args.
@@ -40,25 +40,20 @@ if [ -z "$VESPA_LLVM_VERSION" ]; then
fi
if $UNPRIVILEGED; then
-cmake3 \
- -DCMAKE_INSTALL_PREFIX=$HOME/vespa \
- -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
- -DEXTRA_LINK_DIRECTORY="/opt/vespa-gtest/lib;/opt/vespa-boost/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm$VESPA_LLVM_VERSION/lib" \
- -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-gtest/include;/opt/vespa-boost/include;/opt/vespa-cppunit/include;/usr/include/llvm$VESPA_LLVM_VERSION" \
- -DCMAKE_INSTALL_RPATH="$HOME/vespa/lib64;/opt/vespa-gtest/lib;/opt/vespa-boost/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/lib64/llvm$VESPA_LLVM_VERSION/lib" \
- -DVESPA_USER=$(id -un) \
- -DVESPA_UNPRIVILEGED=yes \
- ${EXTRA_CMAKE_ARGS} \
- -DVESPA_LLVM_VERSION=$VESPA_LLVM_VERSION \
- "${SOURCE_DIR}"
+ VESPA_INSTALL_PREFIX="$HOME/vespa"
+ UNPRIVILEGED_ARGS="-DVESPA_USER=$(id -un) -DVESPA_UNPRIVILEGED=yes"
else
+ VESPA_INSTALL_PREFIX="/opt/vespa"
+ UNPRIVILEGED_ARGS=""
+fi
+
cmake3 \
- -DCMAKE_INSTALL_PREFIX=/opt/vespa \
+ -DCMAKE_INSTALL_PREFIX=${VESPA_INSTALL_PREFIX} \
-DJAVA_HOME=/usr/lib/jvm/java-openjdk \
-DEXTRA_LINK_DIRECTORY="/opt/vespa-gtest/lib;/opt/vespa-boost/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm$VESPA_LLVM_VERSION/lib" \
-DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-gtest/include;/opt/vespa-boost/include;/opt/vespa-cppunit/include;/usr/include/llvm$VESPA_LLVM_VERSION" \
- -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-gtest/lib;/opt/vespa-boost/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/lib64/llvm$VESPA_LLVM_VERSION/lib" \
+ -DCMAKE_INSTALL_RPATH="${VESPA_INSTALL_PREFIX}/lib64;/opt/vespa-gtest/lib;/opt/vespa-boost/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/lib64/llvm$VESPA_LLVM_VERSION/lib" \
+ ${UNPRIVILEGED_ARGS} \
${EXTRA_CMAKE_ARGS} \
-DVESPA_LLVM_VERSION=$VESPA_LLVM_VERSION \
"${SOURCE_DIR}"
-fi
