title | layout |
---|---|
compile mana on windows with cmake |
wiki |
{% include toc.md %}
- Get the Mana sources either from git or download the latest release. We'll assume they are at
C:\mana
- Get the mana_libs.zip package
- Extract
mana_libs.zip
somewhere (current version creates atmw_libs
directory). For this howto we'll assumeC:\tmw_libs
- Install CMake. Be sure to tell it to add itself to the system PATH during the installation (unless you know wat you're doing), either for current or all users.
- Install MinGW. Take the latest Automated MinGW Installer and be sure to check C++ from the MinGW Compiler Suite. Install location is assumed to be
C:\MinGW
.\ - Add the MinGW bin directory
C:\MinGW\bin
to yourPATH
(My Computer -> Properties -> Advanced -> Environment Variables -> Edit PATH -> Append;C:\MinGW\bin
, including the semicolon unless the variable didn't exist yet).
Now that was the whole installation procedure. Now let's start on the actual compiling.
- Open a command prompt (Start -> Run ->
cmd
) - Verify that
cmake
andg++
are available (otherwise something went wrong in the install procedure above, and it makes no sense to continue without fixing that) - Go to
C:\mana
(typec:
and thencd \mana
) - Generate Makefiles with CMake by doing:
cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH=C:\tmw_libs\include -DCMAKE_LIBRARY_PATH=C:\tmw_libs\lib -DSDL_INCLUDE_DIR=C:\tmw_libs\include\SDL -DSDLIMAGE_INCLUDE_DIR=C:\tmw_libs\include\SDL -DSDLMIXER_INCLUDE_DIR=C:\tmw_libs\include\SDL -DSDLNET_INCLUDE_DIR=C:\tmw_libs\include\SDL -DSDLTTF_INCLUDE_DIR=C:\tmw_libs\include\SDL -DMINGW_INCLUDE_DIR=C:\MinGW\include
(Yes, this command is insane, we should look into shortening that up a bit...)
- Check that it went alright (it should say "
-- Build files have been written to: C:/mana
" at the end) - Start compiling by typing
mingw32-make