Mercurial > molko
comparison INSTALL.md @ 315:3bfaaf5342a9
cmake: add support for Visual Studio 2019
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 22 Sep 2021 10:04:15 +0200 |
parents | 8523fb0c8540 |
children | 06782f7888f3 |
comparison
equal
deleted
inserted
replaced
314:d01e83210ca2 | 315:3bfaaf5342a9 |
---|---|
4 Installation instructions. | 4 Installation instructions. |
5 | 5 |
6 Requirements | 6 Requirements |
7 ------------ | 7 ------------ |
8 | 8 |
9 - C11 compliant compiler, | 9 - C11 compliant compiler. |
10 - POSIX system (make, ar, shell), | 10 - [CMake][], CMake build system. |
11 - [pkg-config][], Helper for libraries. | 11 - [Jansson][], JSON parsing library. |
12 - [Jansson][], JSON parsing library, | 12 - [SDL2][], Multimedia library. |
13 - [SDL2][], Multimedia library, | 13 - [SDL2_image][], Image loading addon for SDL2. |
14 - [SDL2_image][], Image loading addon for SDL2, | 14 - [SDL2_mixer][], Audio addon for SDL2. |
15 - [SDL2_ttf][], Fonts addon for SDL2, | 15 - [SDL2_ttf][], Fonts addon for SDL2, |
16 - [SDL2_mixer][], Audio addon for SDL2. | 16 - [gettext][], For translations (optional). |
17 - [zstd][], For compression (optional). | |
17 | 18 |
18 Basic installation | 19 Basic installation |
19 ------------------ | 20 ------------------ |
20 | 21 |
21 Quick install. | 22 Quick install. |
22 | 23 |
23 $ tar xvzf molko-x.y.z-tar.xz | 24 $ tar xvzf molko-x.y.z-tar.xz |
24 $ cd molko-x.y.z | 25 $ cd molko-x.y.z |
25 $ make | 26 $ cmake -S. -Bbuild |
26 # sudo make install | 27 $ cmake --build build --target all |
27 $ molko | 28 # cmake --build build --target install |
29 $ mlk-adventure | |
28 | 30 |
29 Available general make targets: | 31 Available options |
32 ----------------- | |
30 | 33 |
31 - `all`: (default): build only molko. | 34 The following options are available: |
32 - `tools`: build tools (e.g. molko-map). | 35 |
33 - `tests`: build tests and run them. | 36 - `MLK_WITH_NLS`: Enable Native Language Support |
34 - `everything`: build molko, tools and tests without running them. | 37 - `MLK_WITH_ZSTD`: Enable map and tileset compression through [zstd][] (default: |
35 - `run`: run molko with data installed in the source tree. | 38 on). |
39 - `MLK_WITH_TESTS`: Enable unit tests (default: on). | |
36 | 40 |
37 Direct use in source tree | 41 Direct use in source tree |
38 ------------------------- | 42 ------------------------- |
39 | 43 |
40 Examples and `mlk-adventure` executable searches for data into a specific | 44 Examples and `mlk-adventure` executable searches for data into a specific |
41 directory, when building those are not already discoverable because targets are | 45 directory, when building those are not already discoverable because targets are |
42 not already installed. | 46 not already installed. |
43 | 47 |
44 You need to install at least the data once using `install-data` target, you can | 48 You need to install at least the data once using `install` target, you can |
45 do this without root access by using a temporary directory and set the | 49 do this without root access by using a temporary directory and set the |
46 `MLK_ROOT` environment variable. | 50 `MLK_ROOT` environment variable. |
47 | |
48 The directory `out` is recommended, see below. | |
49 | |
50 $ make DESTDIR=out install-data | |
51 $ MLK_ROOT=out ./mlk-adventure/mlk-adventure | |
52 (or to run examples:) | |
53 $ MLK_ROOT=out ./examples/example-action/main | |
54 | |
55 There is a special target `run` that automatically create the diretory `out` | |
56 with all data and binaries installed and runs `mlk-adventure`. | |
57 | 51 |
58 Platform: Windows | 52 Platform: Windows |
59 ----------------- | 53 ----------------- |
60 | 54 |
61 On Windows, only [MSYS2][] is supported. | 55 On Windows, [MSYS2][] and Visual Studio are supported. |
62 | 56 |
63 The code may compile on Microsoft Visual Studio but no support for it is | 57 ### MSYS2 |
64 provided as it is not opensource and not standard compliant. | |
65 | 58 |
66 Once you have MSYS2 installed, simply install the following packages from the | 59 Once you have MSYS2 installed, simply install the following packages from the |
67 appropriate MinGW shell prior to the chapter above. | 60 appropriate MinGW shell prior to the chapter above. |
68 | 61 |
69 - *make* | 62 - *make* |
70 - *mingw-w64-x86_64-pkg-config* | |
71 - *mingw-w64-x86_64-gcc* | 63 - *mingw-w64-x86_64-gcc* |
72 - *mingw-w64-x86_64-SDL2* | 64 - *mingw-w64-x86_64-SDL2* |
73 - *mingw-w64-x86_64-SDL2_image* | 65 - *mingw-w64-x86_64-SDL2_image* |
74 - *mingw-w64-x86_64-SDL2_mixer* | 66 - *mingw-w64-x86_64-SDL2_mixer* |
75 - *mingw-w64-x86_64-SDL2_ttf* | 67 - *mingw-w64-x86_64-SDL2_ttf* |
76 - *mingw-w64-x86_64-jansson* (only for mlk-map/mlk-tileset tools) | 68 - *mingw-w64-x86_64-jansson* (only for mlk-map/mlk-tileset tools) |
69 - *mingw-w64-x86_64-zstd* (only if `MLK_WITH_ZSTD` is set) | |
77 | 70 |
78 Note: replace `x86_64` with `i686` if you have a deprecated system or if you | 71 Note: replace `x86_64` with `i686` if you have a deprecated system or if you |
79 have issues while debugging (MinGW-w64 and/or gdb have known issues in | 72 have issues while debugging (MinGW-w64 and/or gdb have known issues in |
80 this area). | 73 this area). |
81 | 74 |
75 ### Visual Studio | |
76 | |
77 On Visual Studio you will need to download or build libraries yourself. It is | |
78 recommended to install all of them in a same directory and hierarchy as | |
79 following: | |
80 | |
81 - <dir>/bin | |
82 - <dir>/lib | |
83 - <dir>/include | |
84 | |
85 Then adding `<dir>/bin` to *PATH* and `<dir>` to *CMAKE_PREFIX_PATH* will allow | |
86 CMake to find libraries. | |
87 | |
88 [CMake][]: http://cmake.org | |
82 [Jansson][]: http://www.digip.org/jansson | 89 [Jansson][]: http://www.digip.org/jansson |
90 [MSYS2]: http://www.msys2.org | |
83 [SDL2]: http://libsdl.org | 91 [SDL2]: http://libsdl.org |
84 [SDL2_image]: https://www.libsdl.org/projects/SDL_image | 92 [SDL2_image]: https://www.libsdl.org/projects/SDL_image |
93 [SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer | |
85 [SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf | 94 [SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf |
86 [SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer | 95 [gettext]: https://www.gnu.org/software/gettext |
87 [MSYS2]: http://www.msys2.org | 96 [zstd]: http://facebook.github.io/zstd |
88 [pkg-config]: http://pkgconf.org |