File: mac-build.sh

package info (click to toggle)
codelite 12.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (81 lines) | stat: -rwxr-xr-x 1,682 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh

BUILD_DIR=build-release
CMAKE_COMMAND="cmake .. "
RUN_CMAKE=0
MAKE_COMMAND="make -j4 "
CLEAN_CMAKE_CACHE=0

##
## Usage
##
usage()
{
    cat <<EOF
Usage:
    `basename $0` [options]
    
Options:
    -h | --help         show this help screen
    -d | --debug        build codelite.app bundle in debug mode (the default is to build in release mode)
    -w | --wxc          enable wxCrafter plugin
    -c | --clean        perform clean
         --cmake        Run cmake before building
         --clear-cache  Clear cmake cache
EOF
    exit 0
}

##
## Parse command line arguments
##
for i in "$@"
do
    case $i in
        "--clear-cache")
            CLEAN_CMAKE_CACHE=1
            ;;
        "-h" | "--help")
            usage
            ;;
        "-d" | "--debug")
            BUILD_DIR=build-debug
            CMAKE_COMMAND="${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug "
            ;;
        "-w" | "--wxc")
            CMAKE_COMMAND="${CMAKE_COMMAND} -DWITH_WXC=1 "
            ;;
        "--cmake")
            RUN_CMAKE=1
            ;;
        "--clean" | "-c")
            MAKE_COMMAND="${MAKE_COMMAND} clean "
            ;;
        * )
            ;;
    esac
done

echo "-- Build directory: " ${BUILD_DIR}
echo "-- CMake command  : " ${CMAKE_COMMAND}

## Make sure we got the build directory properly
mkdir -p ${BUILD_DIR}

## cd ...
cd ${BUILD_DIR}

## Execute cmake
if [ ${RUN_CMAKE} -eq 1 ]; then
    if [ ${CLEAN_CMAKE_CACHE} -eq 1 ]; then
        echo "-- Clearing CMake cache file"
        rm -f CMakeCache.txt
    fi
    ${CMAKE_COMMAND}
fi

${MAKE_COMMAND}

echo "-- Creating bundle codelite.app ...."
cd pack && ./make_mac_bundle.sh
echo "-- Done"