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"
|