Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake support #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(mayhem2)

set (CMAKE_CXX_STANDARD 11)

set(SOURCES
allegro_compatibility.cpp
mapping_joy.cpp
platform_data.cpp
utils.cpp
battle_sequence.cpp
mapping_key.cpp
player_info.cpp
vaisseau_data.cpp
collision.cpp
menuhandler.cpp
Mayhem2.cpp
player_input.cpp
vaisseau_gfx.cpp
command.cpp
#netgame.cpp
player_view.cpp
game_mgr.cpp
option.cpp
soundfx.cpp
intro_sequence.cpp
physics.cpp
ticktimer.cpp
xc.cpp
)

add_executable(mayhem2 ${SOURCES})

if (UNIX OR MSYS)
set(ALLEGRO_LIBS
allegro
allegro_primitives
allegro_audio
allegro_image
allegro_font
allegro_ttf
allegro_acodec)
target_link_libraries(mayhem2 ${ALLEGRO_LIBS})
endif()

file(COPY assets DESTINATION .)
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,52 @@ You maybe presented with message saying that the application was stopped from st

## Compile

Mayhem2 is compiled with [mingw](http://www.mingw.org/), use mingw32-make to build, paths in the MakeFile may need to be changed.
### Windows using MSYS2

Download and install [MSYS2](http://www.msys2.github.io). Open MinGW 64-bit or MinGW 32-bit shell depending on your architechture.

Install dependencies:

For mingw64 using i686:
```
pacman -S git make mingw-w64-i686-allegro mingw-w64-i686-make mingw-w64-i686-cmake mingw-w64-i686-gcc mingw-w64-i686-openal mingw-w64-i686-dumb mingw-w64-i686-freetype mingw-w64-i686-libvorbis mingw-w64-i686-flac mingw-w64-i686-libjpeg
```

For mingw64 using x86_64:
```
pacman -S git make mingw-w64-x86_64-allegro mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-openal mingw-w64-x86_64-dumb mingw-w64-x86_64-freetype mingw-w64-x86_64-libvorbis mingw-w64-x86_64-flac mingw-w64-x86_64-libjpeg
```

Clone repository, compile and run:
```
git clone https://github.com/martinohanlon/mayhem.git
cd mayhem
mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make
./mayhem2.exe
```

### Ubuntu

Install dependencies:

```
sudo apt-get install liballegro5-dev git cmake
```

Clone repository, compile and run:

```
git clone https://github.com/martinohanlon/mayhem.git
cd mayhem
mkdir build
cd build
cmake ..
make
./mayhem2
```

## Version history
* beta - compiles, runs, ongoing mods
Expand Down