* fix build on OS X via CMake

This commit is contained in:
alexey.lysiuk 2013-06-28 11:02:55 +03:00
parent 57324f6fd8
commit 28fd035b22
4 changed files with 26 additions and 3 deletions

View file

@ -371,6 +371,20 @@ if( NOT NO_ASM )
ENDMACRO( ADD_ASM_FILE ) ENDMACRO( ADD_ASM_FILE )
endif( NOT NO_ASM ) 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 # Decide on SSE setup
set( SSE_MATTERS NO ) set( SSE_MATTERS NO )
@ -522,6 +536,12 @@ if( FLUIDSYNTH_FOUND )
endif( NOT DYN_FLUIDSYNTH ) endif( NOT DYN_FLUIDSYNTH )
endif( FLUIDSYNTH_FOUND ) 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 # Start defining source files for ZDoom
if( WIN32 ) if( WIN32 )

View file

@ -3,6 +3,7 @@
#if defined(__APPLE__) #if defined(__APPLE__)
#define APIENTRY #define APIENTRY
#define APIENTRYP *
#endif // __APPLE__ #endif // __APPLE__
#include "basictypes.h" #include "basictypes.h"

View file

@ -156,14 +156,14 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
cancelled = false; cancelled = false;
app = [NSApplication sharedApplication]; 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); NSRect frame = NSMakeRect(0, 0, 440, 450);
window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO]; window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];
[window setTitle:windowTitle]; [window setTitle:windowTitle];
NSTextField *description = [[NSTextField alloc] initWithFrame:NSMakeRect(22, 379, 412, 50)]; 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]; [[window contentView] addSubview:description];
[description release]; [description release];

View file

@ -321,7 +321,9 @@ SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen)
#if defined(__APPLE__) #if defined(__APPLE__)
// Need to set title here because a window is not created yet when calling the same function from main() // 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__ #endif // __APPLE__
} }