diff --git a/.gitignore b/.gitignore index fbf33d3..a381745 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ cmake_install.cmake CMakeCache.txt Libraries_src/* Makefile +build/* diff --git a/CMakeLists.txt b/CMakeLists.txt index b436758..2bfbdb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,19 @@ set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE}) #Inclusion de Module CMake set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_module/") +IF (APPLE) + execute_process(COMMAND BREW="$(brew --prefix openal-soft)") + include_directories($ENV{BREW}/include) + link_directories($ENV{BREW}/lib) + execute_process(COMMAND GLUT="$(brew --prefix freeglut)") + include_directories($ENV{GLUT}/include) + link_directories($ENV{GLUT}/lib) + execute_process(COMMAND GLEW="$(brew --prefix glew)") + include_directories($ENV{GLEW}/include) + link_directories($ENV{GLEW}/lib) + link_directories(/System/Library/Frameworks/OpenGL.framework/Libraries/) +ENDIF() + #Inclusion de Boost IF (WIN32) diff --git a/configure.sh b/configure.sh index 0093a88..0cd75f3 100644 --- a/configure.sh +++ b/configure.sh @@ -1,3 +1,19 @@ #!/bin/bash -sudo apt install libsdl2* libglew* libglut* libglew-dev:i386 libsndfile-dev -y -cmake . && cmake . 1>/dev/null # deux fois car sinon erreur de compilation +if [ "$(uname)" == "Darwin" ]; then + brew install glew + brew install alut + brew install sdl2_image + brew install sdl2_ttf + brew install sdl2_mixer + brew install openal-soft + brew install libsndfile + brew install freeglut + cmake . && cmake . 1>/dev/null # deux fois car sinon erreur de compilation +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + sudo apt install libsdl2* libglew* libglut* libglew-dev:i386 libsndfile-dev -y + cmake . && cmake . 1>/dev/null # deux fois car sinon erreur de compilation +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then + # Do something under 32 bits Windows NT platform +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then + # Do something under 64 bits Windows NT platform +fi diff --git a/src/audio/audio.h b/src/audio/audio.h index 21bfddf..949d9df 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -1,8 +1,19 @@ #ifndef AUDIO_H #define AUDIO_H -#include -#include +#ifdef _WIN32 + +#elif __APPLE__ + #include "TargetConditionals.h" + #if TARGET_OS_MAC + #include + #include + #endif +#elif __linux__ + #include + #include +#endif + #include #include #include diff --git a/src/display/window.h b/src/display/window.h index a38fc40..a875f7e 100644 --- a/src/display/window.h +++ b/src/display/window.h @@ -2,9 +2,20 @@ #define WINDOW_H #include + #include -#include -#include +#ifdef _WIN32 + +#elif __APPLE__ + #include "TargetConditionals.h" + #if TARGET_OS_MAC + #include + #include + #endif +#elif __linux__ + #include + #include +#endif #include #include diff --git a/src/render/renderer.h b/src/render/renderer.h index 3226eab..60faa6d 100644 --- a/src/render/renderer.h +++ b/src/render/renderer.h @@ -9,7 +9,11 @@ #include #include #include -#include +#if defined(__MACH__) + #include +#else + #include +#endif #include #include #include @@ -18,8 +22,18 @@ #include #include -#include -#include +#ifdef _WIN32 + +#elif __APPLE__ + #include "TargetConditionals.h" + #if TARGET_OS_MAC + #include + #include + #endif +#elif __linux__ + #include + #include +#endif bool fileExists(const std::string&);