Commits

Holger Frydrych committed 0dda599

Added new SDK build script for MinGW

Comments (0)

Files changed (2)

SDK/Win32/mingwsdk.bat

+@echo off
+
+rem check MinGW make availability
+mingw32-make --version > NUL
+if errorlevel 1 goto mingwerror
+rem check 7z and dot
+7z > NUL
+if errorlevel 1 goto 7zerror
+dot -V > NUL
+if errorlevel 1 goto doterror
+
+
+set BUILD_DIR=mingw
+set GENERATOR="MinGW Makefiles"
+
+if "%1" == "clean" rmdir /Q/S %BUILD_DIR%
+mkdir %BUILD_DIR%
+pushd %BUILD_DIR%
+
+rem Build release binaries and docs
+mkdir release
+pushd release
+rem call CMake
+cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -DOGRE_INSTALL_DEPENDENCIES:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=%cd%\..\SDK -DCMAKE_BUILD_TYPE="Release" -G%GENERATOR% ..\..\..\..
+if errorlevel 1 goto cmakeerror
+rem call twice to ensure all variables are set properly
+cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -DOGRE_INSTALL_DEPENDENCIES:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=%cd%\..\SDK -DCMAKE_BUILD_TYPE="Release" -G%GENERATOR% ..\..\..\..
+if errorlevel 1 goto cmakeerror
+rem Read OGRE version
+set /p OGREVERSION=<version.txt
+
+rem build docs explicitly since INSTALL doesn't include it
+mingw32-make doc
+if errorlevel 1 goto docserror
+rem Delete unnecessary doc files
+pushd api\html
+del /Q/F *.hhk *.hhc *.map *.md5 *.dot *.hhp *.plist
+popd
+
+rem Build release binaries
+mingw32-make install -j
+popd
+
+rem Build debug binaries
+mkdir debug
+pushd debug
+rem call CMake
+cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -DOGRE_INSTALL_DEPENDENCIES:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=%cd%\..\SDK -DCMAKE_BUILD_TYPE="Debug" -G%GENERATOR% ..\..\..\..
+if errorlevel 1 goto cmakeerror
+rem call twice to ensure all variables are set properly
+cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -DOGRE_INSTALL_DEPENDENCIES:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=%cd%\..\SDK -DCMAKE_BUILD_TYPE="Debug" -G%GENERATOR% ..\..\..\..
+if errorlevel 1 goto cmakeerror
+mingw32-make install -j
+popd
+
+rem Copy BuildSamples files
+pushd SDK
+copy ..\..\mingw_BuildSamples.bat BuildSamples.bat
+copy ..\..\mingw_BuildSamples.txt BuildSamples.txt
+
+rem strip Release DLLs/EXEs
+pushd bin\Release
+strip --strip-all Ogre*.dll
+strip --strip-all Plugin*.dll
+strip --strip-all RenderSystem*.dll
+strip --strip-all OIS.dll
+strip --strip-all *.exe
+popd
+
+popd
+
+popd
+
+rem Package up
+set SDKNAME=OgreSDK_MinGW_v%OGREVERSION%
+rmdir /S/Q %SDKNAME%
+move %BUILD_DIR%\sdk %SDKNAME%
+del /Q/F %SDKNAME%.exe
+rem create self-extracting 7zip archive
+7z a -r -y -sfx7z.sfx %SDKNAME%.exe %SDKNAME%
+
+echo Done! Test %SDKNAME%.exe and then release
+goto end
+
+:mingwerror
+echo MinGW make not found on your path, please add
+goto end
+
+:cmakeerror
+popd
+echo CMake not found on your path or CMake error - see above and correct
+goto end
+
+:7zerror
+echo 7z.exe not found on your path, please add
+goto end
+
+:doterror
+echo dot.exe not found on your path, please add
+goto end
+
+:docserror
+popd
+echo Could not create docs - missing doxygen?
+goto end
+
+:end
+

SDK/Win32/mingwsdk.sh

-#!/bin/bash
-# Call this file from MSYS!
-
-# check if cmake is available
-if ! which cmake.exe >/dev/null 2>&1; then
-	echo "CMake could not be found. Please ensure that cmake.exe is in your \$PATH."
-	exit 1
-fi
-# check if 7z is available
-if ! which 7z.exe >/dev/null 2>&1; then
-	echo "7z could not be found. Please ensure that 7z.exe is in your \$PATH."
-	exit 1
-fi
-
-# check if OGRE_DEPENDENCIES_DIR is set
-if [ -z "${OGRE_DEPENDENCIES_DIR}" ]; then
-	echo "OGRE_DEPENDENCIES_DIR is not set."
-	echo "You should set this to the path of the Ogre dependency libs."
-	echo "Press ENTER to continue, CTRL-C to abort."
-	read
-fi
-
-# check if BOOST_ROOT is set
-if [ -z "${BOOST_ROOT}" ]; then
-	echo "BOOST_ROOT is not set."
-	echo "You should set this to the path of your Boost installation."
-	echo "Press ENTER to continue, CTRL-C to abort."
-	read
-fi
-
-
-ROOT_DIR=`pwd`
-
-# prepare output directories
-mkdir -p mingw/debug
-mkdir -p mingw/release
-mkdir -p mingw/OgreSDK
-
-# do Debug build first
-cd mingw/debug
-cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="${ROOT_DIR}/mingw/OgreSDK" -DOGRE_BUILD_SAMPLES=FALSE -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE ../../../../
-make $@
-make install
-
-# now do Release build
-cd ../release
-cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="${ROOT_DIR}/mingw/OgreSDK" -DOGRE_BUILD_SAMPLES=FALSE -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_INSTALL_DOCS=TRUE ../../../../
-make $@
-# build API docs
-make doc
-make install
-
-# get Ogre version
-OGRE_VERSION=`cat version.txt`
-
-# copy the BuildSamples* files
-cd ../OgreSDK
-cp ../../mingw_BuildSamples.bat BuildSamples.bat
-cp ../../mingw_BuildSamples.txt BuildSamples.txt
-
-# strip Release DLLs/EXEs
-cd bin/release
-strip --strip-all {Ogre,Plugin,RenderSystem}*.dll
-strip --strip-all OIS.dll
-strip --strip-all *.exe
-
-# pack up SDK
-cd ../../..
-OGRESDK="OgreSDK_mingw_v${OGRE_VERSION}"
-mv OgreSDK ${OGRESDK}
-# create self-extracting 7zip archive
-7z a -r -y -sfx ${OGRESDK}.exe ${OGRESDK}