CMAKE_INSTALL_PREFIX
EXECUTABLE_OUTPUT_PATH
LIBRARY_OUTPUT_PATH
+ CMAKE_OSX_ARCHITECTURES
+ CMAKE_OSX_SYSROOT
)
## For autopackage
ADD_DEFINITIONS(-fno-strict-aliasing)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ ADD_DEFINITIONS(-DMACOSX)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
## On Windows, add an icon
#ifndef __OPENAL_SOUND_SOURCE_H__
#define __OPENAL_SOUND_SOURCE_H__
-#include <al.h>
+#ifndef MACOSX
+#include <AL/al.h>
+#else
+#include <OpenAL/al.h>
+#endif
+
#include "math/vector.hpp"
#include "sound_source.hpp"
#include <vector>
#include <map>
-#include <alc.h>
-#include <al.h>
+#ifndef MACOSX
+#include <AL/alc.h>
+#include <AL/al.h>
+#else
+#include <OpenAL/alc.h>
+#include <OpenAL/al.h>
+#endif
+
#include "math/vector.hpp"
class SoundFile;
#include <SDL_image.h>
#ifdef MACOSX
-# include <CoreFoundation/CoreFoundation.h>
+namespace supertux_apple {
+#include <CoreFoundation/CoreFoundation.h>
+}
#endif
#include "gameconfig.hpp"
}
#ifdef MACOSX
+{
+ using namespace supertux_apple;
+
// when started from Application file on Mac OS X...
char path[PATH_MAX];
CFBundleRef mainBundle = CFBundleGetMainBundle();
assert(mainBundle != 0);
CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
assert(mainBundleURL != 0);
- CFStringRef pathStr = CFUrlCopyFileSystemPath(mainBundleURL, kCFURLPOSIXPathStyle);
+ CFStringRef pathStr = CFURLCopyFileSystemPath(mainBundleURL, kCFURLPOSIXPathStyle);
assert(pathStr != 0);
CFStringGetCString(pathStr, path, PATH_MAX, kCFStringEncodingUTF8);
CFRelease(mainBundleURL);
sourcedir = true;
}
}
+}
#endif
#ifdef _WIN32
#endif
#ifdef MACOSX
-#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
#endif
#include "findlocale.hpp"
#include <sstream>
#include <stdexcept>
+
+#ifndef MACOSX
#include <GL/gl.h>
#include <GL/glext.h>
+#else
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#endif
static inline void check_gl_error(const char* message)
{
## Add target for bison parser generation
+MARK_AS_ADVANCED(BISON_EXECUTABLE)
FIND_PROGRAM(BISON_EXECUTABLE bison)
IF (NOT BISON_EXECUTABLE)
MESSAGE(FATAL_ERROR "bison not found - aborting")
## Add target for flex lexical analyzer generation
+MARK_AS_ADVANCED(FLEX_EXECUTABLE)
FIND_PROGRAM(FLEX_EXECUTABLE flex)
IF (NOT FLEX_EXECUTABLE)
MESSAGE(FATAL_ERROR "flex not found - aborting")