Hi,
I just set up a batch script to check for SFML updates on git Master and to auto build all the libraries I maybe need (Debug/Release, both static and dynamic).
I thought this could maybe come in handy for anyone, so I share it.
The script builds the MinGW Makefiles. If you want other Makefiles, you have to exchange the specific lines.
Type
cmake --help
to see all the options and call the specific commands for your build environment.
Git, compiler and cmake should be in the PATH of your OS to work out of the box.
Tested with Windows 10.
The batch script
@echo off
REM Go into the SFML source folder and get the latest version of master
REM These commands will discard any commits and delete none tracked files!!!
cd SFML
git checkout master
git reset --hard HEAD
git clean -f
git pull
REM Create a build directory if it does not exist
IF NOT EXIST Build mkdir Build
SET /p input="Build(y/n): "
IF /i "%input%" == "n" GOTO end
REM Build Release/Debug in both, static and dynamic versions, for MinGW
cd Build
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=false ../
mingw32-make
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=true ../
mingw32-make
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=false ../
mingw32-make
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=true ../
mingw32-make
cd ..
:end
echo "Finished!"
cd ..
Usage:
- Open git bash
- Clone SFML via git:
git clone https://github.com/SFML/SFML.git
- This will create a new folder "SFML" with all the sources in the working directory.
- Copy this batch file in the working directory (same level as the SFML folder!!!)
Anytime you want to check for updates, run the script.
After pulling the latest version, the script will ask you, if you want to build all the libraries.
Type "y" or "n" to do it or not
If you are "up-to-date" you don't need to build the libs, unless you didn't already.
Hope it helps!
Regards,
AncientGrief