diff --git a/README.md b/README.md index b17a920a..957fd0ca 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Though Marble Marcher CE is a largely finished game, there are still several imp ### MacOS On macOS these can be conveniently installed using [HomeBrew](https://brew.sh): -`brew install cmake eigen sfml anttweakbar` +`brew install cmake eigen sfml anttweakbar glew glm` The version of SFML required is 2.5.1 or newer. It has come to my attention that HomeBrew does now have this version (unlike when these instructions where first written) so installing via HomeBrew should work but you can still [download manually](https://www.sfml-dev.org/download/sfml/2.5.1/) if you wish and install using [these instructions](https://www.sfml-dev.org/tutorials/2.5/start-osx.php). You must install the Frameworks option not the dylib option or the build script may fail. **Note that if HomeBrew installed a version of SFML older than 2.5.1 for some reason or you wish to install manually, you must remove the version of SFML that Brew installed using `brew remove sfml`.** @@ -141,8 +141,11 @@ However, `anttweakbar` is on the AUR. Clone and build it yourself, or use and AU ### MacOS #### Build Script **Note for the current version: the macOS build is not yet entirely working properly so revert to the previous prerelease as required. SFML is properly included but as of yet, AntTweakBar is not so this executable will not work on machines without it installed.** -Simply run `./macOSBuild.sh`. This will generate the full Application bundle that can be used like any other application. It can even be used on systems without SFML as SFML is included in the bundle and the binary is relinked to these versions. Currently the script will only do the relinking part properly if you use SFML 2.5.1 specifically however it is planned to allow for any version. If you have another version, the script will still work, the app just won't work on a machine without SFML. +Simply run `./macOSBuildExec.sh` ( You can alternatively use macOSBuildBundle which is the old version of the script, which will generate a full .app file instead of a normal unix executable). This will generate the MarbleMarcher executable that can be used like any other application. It can even be used on systems without SFML as SFML is included in the bundle and the binary is relinked to these versions (As stated above it currently does not work on systems without AntTweakBar installed). Currently the script will only do the relinking part properly if you use SFML 2.5.1 specifically however it is planned to allow for any version. If you have another version, the script will still work, the app just won't work on a machine without SFML. #### Manual +Due to macOS being unable to find GLM_INCLUDE_DIR it is now assumed to be ./glm . In order for this method to work, GLM should now be manually installed into that directory. +* `wget https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip` +* `unzip ./glm-0.9.9.8.zip` * `mkdir build && cd build` * `cmake ..` * `cmake -DCMAKE_CXX_FLAGS="-I/usr/local/include" ..` @@ -150,7 +153,7 @@ Simply run `./macOSBuild.sh`. This will generate the full Application bundle tha * `cd ..` * `cmake --build build` -Note that this just builds a binary and not an Application bundle like you might be used to seeing. To run properly, you must move the binary (which, after building, is `build/MarbleMarcher`) to the same folder as the assets folder. It is not recommended to build the Application bundle manually so no instructions for that are provided however you may peek in `macOSBuild.sh` to see how it is done. +Note that this just builds a binary and not an Application bundle like you might be used to seeing. To run properly, you must move the binary (which, after building, is `build/MarbleMarcher`). It is not recommended to build the Application bundle manually so no instructions for that are provided however you may peek in `macOSBuildBundle.sh` to see how it is done. Alternatively, one can use the platform-dependent build system, for example `Make`: diff --git a/macOSBuild.sh b/macOSBuild.sh deleted file mode 100755 index 16fe27d2..00000000 --- a/macOSBuild.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash - -mkdir -p build && cd build -cmake .. -cd .. -cmake --build build - -rm -R -f MarbleMarcher.app -cp -R macOS/template MarbleMarcher.app -cp macOS/MarbleMarcher.icns MarbleMarcher.app/Contents/Resources/ -cp -R assets MarbleMarcher.app/Contents/Resources/ -mv build/MarbleMarcher MarbleMarcher.app/Contents/Resources/ -cp -R game_folder/* MarbleMarcher.app/Contents/Resources -cp build/AntTweakBar.dll MarbleMarcher.app/Contents/Resources/ -cp -R build/assets MarbleMarcher.app/Contents/Resources -cp -R build/images MarbleMarcher.app/Contents/Resources -cp -R build/screenshots MarbleMarcher.app/Contents/Resources -cp -R build/shaders MarbleMarcher.app/Contents/Resources -cp -R build/sound MarbleMarcher.app/Contents/Resources - - -cd MarbleMarcher.app/Contents/Resources -install_name_tool -change @rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics @executable_path/sfml-graphics MarbleMarcher -install_name_tool -change @rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio @executable_path/sfml-audio MarbleMarcher -install_name_tool -change @rpath/sfml-window.framework/Versions/2.5.1/sfml-window @executable_path/sfml-window MarbleMarcher -install_name_tool -change @rpath/sfml-system.framework/Versions/2.5.1/sfml-system @executable_path/sfml-system MarbleMarcher diff --git a/macOSBuildBundle.sh b/macOSBuildBundle.sh new file mode 100755 index 00000000..8ee1e2dd --- /dev/null +++ b/macOSBuildBundle.sh @@ -0,0 +1,25 @@ +echo This script will install brew and various libraries required for the build. Wait 5 seconds if you allow us to install files into your computer. +sleep 5 + +which -s brew +if [[ $? != 0 ]] ; then + brewinstalled=0 + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +fi + +brew install cmake eigen sfml anttweakbar glm glew + +cd "$(dirname "$0")" +wget https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip +unzip glm-0.9.9.8.zip + +mkdir build && cd build +cmake .. +cmake -DCMAKE_CXX_FLAGS="-I/usr/local/include" .. +cd .. +cmake --build build + +cd build +echo cd "$(dirname "$0")" > MarbleMarcher.sh +echo ./MarbleMarcher >> MarbleMarcher.sh +./MarbleMarcher diff --git a/macOSBuildExec.sh b/macOSBuildExec.sh new file mode 100755 index 00000000..a0b90878 --- /dev/null +++ b/macOSBuildExec.sh @@ -0,0 +1,28 @@ +#I wanted the compliation to be more "You just launch the script and it works" so, it's just a improved version of the manual method. + +#The script installs glm manually into the working directory, because for some weird reason cmake can just never find the file. If it's against the license agreements ( the GLM this script downloads is licensed under a modified version of MIT https://github.com/g-truc/glm/blob/master/copying.txt so it SHOULD be ok. ) please let me know. + +echo This script will install brew and various libraries required for the build. Wait 5 seconds if you allow us to install files into your computer. +sleep 5 + +which -s brew +if [[ $? != 0 ]] ; then + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +fi + +brew install cmake eigen sfml anttweakbar glm glew + +cd "$(dirname "$0")" +wget https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip +unzip glm-0.9.9.8.zip + +mkdir build && cd build +cmake .. +cmake -DCMAKE_CXX_FLAGS="-I/usr/local/include" .. +cd .. +cmake --build build + +cd build +echo cd "$(dirname "$0")" > MarbleMarcher.sh +echo ./MarbleMarcher >> MarbleMarcher.sh +./MarbleMarcher