source: pacpusframework/trunk/scripts/build-linux.sh@ 332

Last change on this file since 332 was 162, checked in by Marek Kurdej, 11 years ago

Update: merged changes from trunk.

File size: 1.8 KB
Line 
1#!/usr/bin/env bash
2
3echo "##########################################################"
4echo "# ___________ ____ ______ __ __ _____ #"
5echo "# \____ \__ \ _/ ___\\____ \^| ^| \/ ___/ #"
6echo "# ^| ^|_^> ^> __ \\ \___^| ^|_^> ^> ^| /\___ \ #"
7echo "# ^| __(____ /\___ ^> __/^|____//____ ^> #"
8echo "# ^|__^| \/ \/^|__^| \/ #"
9echo "# #"
10echo "##########################################################"
11echo ""
12echo "========================================"
13echo " PACPUS BUILD Linux "
14echo "========================================"
15
16
17function usage {
18 echo Usage:
19 echo build-linux.sh [install_dir]
20 echo [install-dir] is optional
21 echo The script must be run in the build directory, which is 'trunk\build'
22 echo ""
23 echo Where:
24 echo install_dir is the installation directory of the library
25 echo ""
26 echo For instance, here is how to build Pacpus:
27 echo ../scripts/build-linux.sh "/opt/Pacpus"
28 echo ""
29 exit 1
30}
31
32function build {
33 # Initialize the build
34 cmake .. -DPACPUS_INSTALL_DIR=$1 -DPACPUS_INSTALL_3RD=TRUE \
35 -DPACPUS_USE_LOG=TRUE -DCMAKE_BUILD_TYPE=Release \
36 -DPACPUS_INSTALL_WITH_VERSION_NUMBER=TRUE
37 make
38 sudo make install
39 cmake .. -DPACPUS_INSTALL_DIR=$1 -DPACPUS_INSTALL_3RD=TRUE \
40 -DPACPUS_USE_LOG=TRUE -DCMAKE_BUILD_TYPE=Debug
41 -DPACPUS_INSTALL_WITH_VERSION_NUMBER=TRUE \
42 make
43 sudo make install
44 echo "Build finished"
45 exit 0
46}
47
48#Check if the user is in the build directory
49if [ `basename $PWD` == "build" ]; then
50 if [ $# -ne 1 ]; then
51 INST_PATH="/opt/pacpus"
52 else
53 INST_PATH=$1
54 fi
55 build $INST_PATH
56else
57 usage
58fi
Note: See TracBrowser for help on using the repository browser.