Fixed: #872 NEL: build on Mac OS X

This commit is contained in:
rti 2010-05-29 18:27:27 +02:00
parent 35c1603f20
commit 2deca37990
4 changed files with 23 additions and 1 deletions

View file

@ -92,8 +92,13 @@ IF(WITH_3D)
IF(WITH_DRIVER_OPENGL)
FIND_PACKAGE(OpenGL)
IF(NOT WIN32)
FIND_PACKAGE(X11)
FIND_PACKAGE(XF86VidMode)
ENDIF(NOT WIN32)
IF(APPLE)
# TODO: remove Carbon as soon as Cocoa Support is stable on Mac
FIND_LIBRARY(CARBON NAMES Carbon)
ENDIF(APPLE)
ENDIF(WITH_DRIVER_OPENGL)
IF(WITH_CEGUI)

View file

@ -120,7 +120,10 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++ -lrt")
SET(PLATFORM_LINKFLAGS "${CMAKE_THREAD_LIBS_INIT} -lc -lm -lstdc++")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lrt")
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6")
SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ")

View file

@ -25,6 +25,14 @@ IF(WIN32)
LINK_FLAGS "/NODEFAULTLIB:libcmt")
ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS)
ELSE(WIN32)
# NOTE: I know, those hardcoded things are evil. But FindOpenGL on Mac simply
# does not look for X11's OpenGL, just for the native one.
# TODO: FIXME remove as soon as Cocoa Support is stable on Mac
IF(APPLE)
INCLUDE_DIRECTORIES("/usr/X11/include")
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON} "-L/usr/X11/lib" "-lGL")
ENDIF(APPLE)
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES})
IF(XF86VidMode_FOUND)
INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})

View file

@ -1,5 +1,11 @@
FILE(GLOB SRC *.cpp *.h)
# TODO: fixes a linking problem for libnelsound.dylib, but does not look like
# the cleanest way to solve the issue. FIXME!
IF(APPLE)
SET(SRC ${SRC} driver/sound_driver.cpp driver/buffer.cpp)
ENDIF(APPLE)
IF(NOT WIN32)
ADD_LIBRARY(nelsound SHARED ${SRC})
ELSE(NOT WIN32)