Skip to content
Open
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ if (BSZENLIB_DOWNLOAD_BSF_BINARIES)
if (WIN32)
FetchContent_Declare(bsfBinaries
SOURCE_DIR ${bsf_INSTALL_DIR}
URL https://dilborceisv8p.cloudfront.net/bsf_2019.01.23_win64.zip
URL http://nightly.bsframework.io/releases/bsf_v1.1.0b_win64.zip
)
elseif (APPLE)
FetchContent_Declare(bsfBinaries
SOURCE_DIR ${bsf_INSTALL_DIR}
URL https://dilborceisv8p.cloudfront.net/bsf_2019.01.23_osx.tar.gz
URL http://nightly.bsframework.io/releases/bsf_v1.1.0b_osx.tar.gz
)
elseif (UNIX)
FetchContent_Declare(bsfBinaries
SOURCE_DIR ${bsf_INSTALL_DIR}
URL https://dilborceisv8p.cloudfront.net/bsf_2019.01.23_linux.tar.gz
URL http://nightly.bsframework.io/releases/bsf_v1.1.0b_linux.tar.gz
)
else()
message(FATAL_ERROR "No prebuilt binaries available for this platform!")
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ https://regoth-project.github.io/BsZenLib/index.html

# Building

BsZenLib requires the following packages to be installed on the system:
`physfs-dev >= 3.0.0` `libsquish-dev`

Most modern Linux distros provide a way to install them via the native package
manager. Ubuntu 18.04+ is known to ship recent enough versions, older distros do not
and installing from source may be necessary.

On Windows, just double-click on `build.bat`. It will manage everything automatically.

Dependencies on Windows are best managed using [vcpkg](https://github.com/Microsoft/vcpkg), you can
find instructions on how to build it on the official repository. Once vcpkg is installed, you should
install the following packages `physfs libsquish` by running
`vcpkg.exe install --target x64-windows-static physfs libsquish`

You will need the bsframework for building BsZenLib. You can either download or compile it yourself, or have CMake download prebuilt binaries
for you.

Expand Down Expand Up @@ -42,7 +56,9 @@ cmake --build . -j 8
## Note for Windows users

Make sure to have CMake use the `Win64` kind of the Visual-Studio generator by passing `-G"Visual Studio 15 2017 Win64"` to it.
Otherwise linking with bs:f will likely fail, since the prebuilt binaries are all 64-bit.
Otherwise linking with bs:f will likely fail, since the prebuilt binaries are all 64-bit. Also, make
sure you add `-DDVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg.cmake`
in order for CMake to be able to find the vcpkg packages.

## Building the Documentation

Expand Down
19 changes: 12 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
version: 0.1.{build}
image: Visual Studio 2017

cache:
- c:\tools\vcpkg\installed\

install:
- cd C:\tools\vcpkg
- git fetch
- git pull
- .\bootstrap-vcpkg.bat
- .\vcpkg.exe install --triplet x64-windows-static physfs glm libsquish
- cd %APPVEYOR_BUILD_FOLDER%

build_script:
- git submodule update --init --recursive
-
- mkdir build
- cd build
- cmake -G"Visual Studio 15 2017 Win64" -DBSZENLIB_DOWNLOAD_BSF_BINARIES=On -DCMAKE_BUILD_TYPE=Release ..
- cmake -G"Visual Studio 15 2017 Win64" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBSZENLIB_DOWNLOAD_BSF_BINARIES=On -DCMAKE_BUILD_TYPE=Release ..
- cmake --build . --config Release -j 4
-
- cp -r bsf-binaries/bin/* bin/Release
- 7z a BsZenLib.zip bin/
-
- mv BsZenLib.zip BsZenLib-%appveyor_repo_branch%-%APPVEYOR_BUILD_VERSION%-win32.zip
- appveyor PushArtifact BsZenLib-%appveyor_repo_branch%-%APPVEYOR_BUILD_VERSION%-win32.zip

11 changes: 11 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set CURRENT_DIR=%~dp0
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
call bootstrap-vcpkg.bat
set VCPKG_ROOT=%CURRENT_DIR%\vcpkg
vcpkg.exe install --triplet x64-windows-static physfs libsquish
cd ..
mkdir build
cd build
cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static "-DCMAKE_TOOLCHAIN_FILE=%CURRENT_DIR%\vcpkg\scripts\buildsystems\vcpkg.cmake" -DBSZENLIB_DOWNLOAD_BSF_BINARIES=ON -G "Visual Studio 15 2017 Win64" ..
cmake --build . -j 8