Debian Codegraph @

build.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright(C) 2023 Sutou Kouhei <[email protected]>
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19 if [ $# -ne 3 ]; then
20 echo "Usage: $0 SOURCE_DIRECTORY BUILD_DIRECTORY INSTALL_PREFIX"
21 echo " e.g.: $0 . /tmp/build /tmp/local"
22 exit 1
23 fi
24
25 set -eux
26
27 source_directory="$1"
28 shift
29 build_directory="$1"
30 shift
31 install_prefix="$1"
32 shift
33
34 rm -rf "${build_directory}"
35 cmake_args=(
36 -S "${source_directory}"
37 -B "${build_directory}"
38 --preset debug-default
39 -DCMAKE_INSTALL_PREFIX="${install_prefix}"
40 )
41 cmake "${cmake_args[@]}" "$@"
42 cmake --build "${build_directory}"
43 cmake --install "${build_directory}"