From 7d42cd5c0ce0706bf55fcbcaa43e6b52a6ab5b9c Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Mon, 17 Oct 2016 23:12:40 +0200 Subject: [PATCH 1/2] Add CMakeLists.txt Link allegro if using Unix or MSYS Copy assets folder to destination to be able to run from compile directory --- CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..40432e3 --- /dev/null +++ b/CMakeLists.txt @@ -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 .) From 933d51c1664dfb4dbef1bd2d1d75f804fea8ffeb Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Wed, 26 Oct 2016 00:41:51 +0200 Subject: [PATCH 2/2] README: Add compilation instructions --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92dd57f..09d4571 100644 --- a/README.md +++ b/README.md @@ -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