File: cmake-test.sh

package info (click to toggle)
compton 1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 776 kB
  • sloc: ansic: 11,631; sh: 295; makefile: 133; python: 114
file content (36 lines) | stat: -rwxr-xr-x 598 bytes parent folder | download | duplicates (4)
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
#!/bin/bash

# Test script for CMake build

BASE_DIR=$(dirname "$0")/..
. "${BASE_DIR}/functions.sh"

BUILD_DIR="build"

cmake_prepare() {
  [ ! -e "CMakeLists.txt" ] && ln -s {_,}CMakeLists.txt
}

cmake_build() {
  einfo Building compton with cmake $@

  [ -e "${BUILD_DIR}" ] && rm -r "${BUILD_DIR}"
  mkdir "${BUILD_DIR}" && cd "${BUILD_DIR}" || die
  cmake ${@} .. || die
  make VERBOSE=1 -B || die
  cd -

  einfo Build completed successfully
}

show_build_help_msg() {
  "${BUILD_DIR}/compton" -h | less
}

main() {
  cmake_prepare
  cmake_build "${@}"
  # show_build_help_msg
}

main "${@}"