From 28fd035b22aa9df0436e86766c93beb83ba4a7ed Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 28 Jun 2013 11:02:55 +0300 Subject: [PATCH] * fix build on OS X via CMake --- src/CMakeLists.txt | 20 ++++++++++++++++++++ src/gl/system/gl_interface.h | 1 + src/sdl/iwadpicker_cocoa.mm | 4 ++-- src/sdl/sdlglvideo.cpp | 4 +++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 50c5f5b22f..dbca574b18 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -371,6 +371,20 @@ if( NOT NO_ASM ) ENDMACRO( ADD_ASM_FILE ) endif( NOT NO_ASM ) +# OpenGL on OS X: Search for GLEW include files + +if( APPLE ) + find_path( GLEW_INCLUDE_DIR GL/glew.h + PATHS "/usr/include" + "/usr/local/include" ) + + if( GLEW_INCLUDE_DIR ) + message( STATUS "GLEW include files found at ${GLEW_INCLUDE_DIR}" ) + else( GLEW_INCLUDE_DIR ) + message( SEND_ERROR "Could not find GLEW include files" ) + endif( GLEW_INCLUDE_DIR ) +endif( APPLE ) + # Decide on SSE setup set( SSE_MATTERS NO ) @@ -522,6 +536,12 @@ if( FLUIDSYNTH_FOUND ) endif( NOT DYN_FLUIDSYNTH ) endif( FLUIDSYNTH_FOUND ) +# OpenGL on OS X: GLEW include directory + +if( APPLE ) + include_directories( "${GLEW_INCLUDE_DIR}" ) +endif( APPLE ) + # Start defining source files for ZDoom if( WIN32 ) diff --git a/src/gl/system/gl_interface.h b/src/gl/system/gl_interface.h index 3d54bf8f60..a6c583343d 100644 --- a/src/gl/system/gl_interface.h +++ b/src/gl/system/gl_interface.h @@ -3,6 +3,7 @@ #if defined(__APPLE__) #define APIENTRY +#define APIENTRYP * #endif // __APPLE__ #include "basictypes.h" diff --git a/src/sdl/iwadpicker_cocoa.mm b/src/sdl/iwadpicker_cocoa.mm index 1a1fa8b8c1..45f0d1a8fb 100644 --- a/src/sdl/iwadpicker_cocoa.mm +++ b/src/sdl/iwadpicker_cocoa.mm @@ -156,14 +156,14 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" }; cancelled = false; app = [NSApplication sharedApplication]; - id windowTitle = [NSString stringWithUTF8String:GAMESIG " " DOTVERSIONSTR ": Select an IWAD to use"]; + id windowTitle = [NSString stringWithFormat:@"%s %s", GAMESIG, GetVersionString()]; NSRect frame = NSMakeRect(0, 0, 440, 450); window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO]; [window setTitle:windowTitle]; NSTextField *description = [[NSTextField alloc] initWithFrame:NSMakeRect(22, 379, 412, 50)]; - [self makeLabel:description:"ZDoom found more than one IWAD\nSelect from the list below to determine which one to use:"]; + [self makeLabel:description:"GZDoom found more than one IWAD\nSelect from the list below to determine which one to use:"]; [[window contentView] addSubview:description]; [description release]; diff --git a/src/sdl/sdlglvideo.cpp b/src/sdl/sdlglvideo.cpp index 6378381e4a..9ee54b4e8a 100644 --- a/src/sdl/sdlglvideo.cpp +++ b/src/sdl/sdlglvideo.cpp @@ -321,7 +321,9 @@ SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen) #if defined(__APPLE__) // Need to set title here because a window is not created yet when calling the same function from main() - SDL_WM_SetCaption( GAMESIG " " DOTVERSIONSTR " (" __DATE__ ")", NULL ); + char caption[100]; + mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); + SDL_WM_SetCaption(caption, NULL); #endif // __APPLE__ }