Browse Source

Add vcpkg.json to the project

pull/2942/head
staphen 5 years ago committed by Anders Jenbo
parent
commit
a3effd5e82
  1. 16
      CMakeLists.txt
  2. 3
      appveyor.yml
  3. 18
      docs/building.md
  4. 27
      vcpkg.json

16
CMakeLists.txt

@ -43,6 +43,11 @@ mark_as_advanced(DISABLE_STREAMING_SOUNDS)
option(STREAM_ALL_AUDIO "Stream all the audio. For extremely RAM-constrained platforms.")
mark_as_advanced(STREAM_ALL_AUDIO)
# The gettext[tools] package takes a very long time to install
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg.cmake$")
option(USE_GETTEXT_FROM_VCPKG "Add vcpkg dependency for gettext[tools] for compiling translations" OFF)
endif()
RELEASE_OPTION(CPACK "Configure CPack")
@ -60,6 +65,13 @@ if(NIGHTLY_BUILD OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CPACK ON)
endif()
if(USE_GETTEXT_FROM_VCPKG)
list(APPEND VCPKG_MANIFEST_FEATURES "translations")
endif()
if(RUN_TESTS)
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
endif()
if(NOT NOSOUND)
option(DEVILUTIONX_SYSTEM_SDL_AUDIOLIB "Use system-provided SDL_audiolib" OFF)
cmake_dependent_option(DEVILUTIONX_STATIC_SDL_AUDIOLIB "Link static SDL_audiolib" OFF
@ -639,6 +651,10 @@ if(GPERF)
find_package(Gperftools REQUIRED)
endif()
if(USE_GETTEXT_FROM_VCPKG)
# vcpkg doesn't add its own tools directory to the search path
list(APPEND Gettext_ROOT ${CMAKE_CURRENT_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/tools/gettext/bin)
endif()
find_package(Gettext)
if (Gettext_FOUND)
foreach(lang bg da de es fr hr it ko_KR pt_BR ru sv zh_CN zh_TW)

3
appveyor.yml

@ -3,14 +3,13 @@ version: 1.0.{build}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2019
cache: c:\tools\vcpkg\installed\
cache: '%LOCALAPPDATA%\vcpkg\archives'
install:
- cd C:\Tools\vcpkg
- git pull
- .\bootstrap-vcpkg.bat
- cd %APPVEYOR_BUILD_FOLDER%
- vcpkg install --recurse fmt:x64-windows sdl2:x64-windows sdl2-ttf:x64-windows libsodium:x64-windows libpng:x64-windows
before_build:
- cmake -G "Visual Studio 16 2019" -A x64 -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake .

18
docs/building.md

@ -124,22 +124,8 @@ of the `(i686|x86_64)-w64-mingw32` directory.
### Installing dependencies
Make sure to install the `C++ CMake tools for Windows` component for Visual Studio.
1. Install vcpkg following the instructions from https://github.com/microsoft/vcpkg#quick-start.
Don't forget to perform _user-wide integration_ step for additional convenience.
2. Install required dependencies by executing the following command (via cmd or powershell):
For the 64-bit version of the dependencies please run this command:
```
vcpkg install fmt:x64-windows sdl2:x64-windows sdl2-ttf:x64-windows libsodium:x64-windows libpng:x64-windows gtest:x64-windows
```
For the 32-bit version of the dependencies please run this command:
```
vcpkg install fmt:x86-windows sdl2:x86-windows sdl2-ttf:x86-windows libsodium:x86-windows libpng:x86-windows gtest:x86-windows
```
Install vcpkg following the instructions from https://github.com/microsoft/vcpkg#quick-start.
Don't forget to perform _user-wide integration_ step for additional convenience.
### Compiling

27
vcpkg.json

@ -0,0 +1,27 @@
{
"name": "devilutionx",
"version-string": "1.2.1",
"dependencies": [
"fmt",
"freetype",
"libpng",
"libsodium",
"sdl2",
"sdl2-ttf"
],
"features": {
"translations": {
"description": "Build translation files",
"dependencies": [
{
"name": "gettext",
"features": [ "tools" ]
}
]
},
"tests": {
"description": "Build tests",
"dependencies": [ "gtest" ]
}
}
}
Loading…
Cancel
Save