[126] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | NAME="[cegui]" |
---|
| 4 | WORKING_DIR="cegui/cegui-0.8.4" |
---|
| 5 | |
---|
| 6 | BUILD_DIR=build |
---|
| 7 | |
---|
| 8 | source ./build_common.sh |
---|
| 9 | |
---|
| 10 | if [ $DO_CLEAN -eq 1 ] |
---|
| 11 | then |
---|
| 12 | rm -rf $BUILD_DIR |
---|
| 13 | check_result $? "cleaning build dir" |
---|
| 14 | rm -rf "dependencies" |
---|
| 15 | check_result $? "remove dependencies" |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | if [ $DO_BUILD -eq 1 ] |
---|
| 19 | then |
---|
| 20 | # copy cegui dependencies |
---|
| 21 | cp -aT "${TEMP_DIR}/ceguideps" "dependencies" |
---|
| 22 | check_result $? "copy ceguideps dependencies" |
---|
| 23 | |
---|
| 24 | # merge ogre dependencies into cegui dependencies |
---|
| 25 | cp -aT "${TEMP_DIR}/ogredeps/include" "dependencies/include" |
---|
| 26 | check_result $? "copy includes" |
---|
| 27 | cp -aT "${TEMP_DIR}/ogredeps/bin/Release" "dependencies/lib" |
---|
| 28 | check_result $? "copy bins" |
---|
| 29 | cp -aT "${TEMP_DIR}/ogredeps/lib/Release" "dependencies/lib" |
---|
| 30 | check_result $? "copy libs" |
---|
| 31 | |
---|
| 32 | # prepare build directory |
---|
| 33 | mkdir -p $BUILD_DIR |
---|
| 34 | check_result $? "creating build dir" |
---|
| 35 | cd $BUILD_DIR |
---|
| 36 | |
---|
| 37 | # run cmake |
---|
| 38 | # add flag for FreeImage to be compatible with the ogre-dependencies |
---|
| 39 | CXXFLAGS="-DFREEIMAGE_LIB" \ |
---|
| 40 | cmake .. -G "MSYS Makefiles" \ |
---|
| 41 | -DOGRE_H_PATH=${TARGET_INC_DIR}/ogre/include \ |
---|
| 42 | -DOGRE_H_BUILD_SETTINGS_PATH=${TARGET_INC_DIR}/ogre/include \ |
---|
| 43 | -DOGRE_LIB=${TARGET_BIN_DIR}/OgreMain.dll \ |
---|
| 44 | -DBOOST_LIBRARYDIR=${TARGET_BIN_DIR} \ |
---|
| 45 | -DBOOST_INCLUDEDIR=${TARGET_INC_DIR}/boost |
---|
| 46 | check_result $? "cmake" |
---|
| 47 | |
---|
| 48 | # compile |
---|
| 49 | make -j8 |
---|
| 50 | check_result $? "make" |
---|
| 51 | |
---|
| 52 | # copy libraries into target directory |
---|
| 53 | find "bin" -name "libCEGUI*.dll" -not -name "*Demo*" -not -name "*Minesweeper*" -exec cp -a {} ${TARGET_BIN_DIR} \; |
---|
| 54 | check_result $? "copying CEGUI-libraries" |
---|
| 55 | |
---|
| 56 | # copy includes |
---|
| 57 | mkdir -p ${TARGET_INC_DIR}/cegui |
---|
| 58 | check_result $? "creating include dir" |
---|
| 59 | cp -aT "../cegui/include/CEGUI" ${TARGET_INC_DIR}/cegui/include |
---|
| 60 | check_result $? "copying includes" |
---|
| 61 | cp -aT "cegui/include/CEGUI" ${TARGET_INC_DIR}/cegui/include |
---|
| 62 | check_result $? "copying generated includes" |
---|
| 63 | |
---|
| 64 | echo "${NAME} Finished building ${NAME}" |
---|
| 65 | fi |
---|