1
0
Fork 0

Add Mac OS X Support

This commit is contained in:
MrDev023 2018-02-06 10:11:01 +01:00
parent 19374461b6
commit 00f760fd75
6 changed files with 75 additions and 9 deletions

1
.gitignore vendored
View file

@ -7,4 +7,5 @@ cmake_install.cmake
CMakeCache.txt
Libraries_src/*
Makefile
build/*

View file

@ -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)

View file

@ -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

View file

@ -1,8 +1,19 @@
#ifndef AUDIO_H
#define AUDIO_H
#include <AL/al.h>
#include <AL/alc.h>
#ifdef _WIN32
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_MAC
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#endif
#elif __linux__
#include <AL/al.h>
#include <AL/alc.h>
#endif
#include <AL/alut.h>
#include <string>
#include <stdio.h>

View file

@ -2,9 +2,20 @@
#define WINDOW_H
#include <SDL2/SDL.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef _WIN32
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_MAC
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#endif
#elif __linux__
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include <stdio.h>
#include <stdlib.h>

View file

@ -9,7 +9,11 @@
#include <sstream>
#include <iterator>
#include <fstream>
#include <malloc.h>
#if defined(__MACH__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <string>
#include <sys/stat.h>
#include <algorithm>
@ -18,8 +22,18 @@
#include <SDL2/SDL.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef _WIN32
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_MAC
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#endif
#elif __linux__
#include <GL/gl.h>
#include <GL/glu.h>
#endif
bool fileExists(const std::string&);