2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> cmake-build.sh"
13 build_dir="${BUILD_DIR:-$WORKSPACE/target}"
14 cmake_opts="${CMAKE_OPTS:-}"
15 make_opts="${MAKE_OPTS:-}"
16 # Not a misspelling as shellcheck reports.
17 # shellcheck disable=SC2153
18 project="${PROJECT//\//\-}"
27 cd "$build_dir" || exit
28 # $cmake_opts needs to wordsplit to pass options.
29 # shellcheck disable=SC2086
30 eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts ..
31 # $make_opts needs to wordsplit to pass options.
32 # shellcheck disable=SC2086
36 mkdir -p "$WORKSPACE/dist"
37 tar -cJvf "$WORKSPACE/dist/$project.tar.xz" -C "$INSTALL_PREFIX" .
39 sudo tar -xvf "$WORKSPACE/dist/$project.tar.xz" -C "/usr/local"