3 FIND_LIBRARY(CARBON NAMES Carbon)
4 FIND_LIBRARY(COCOA NAMES Cocoa)
5 FIND_PACKAGE(OpenGL REQUIRED)
7 SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
8 SET(CMAKE_FIND_LIBRARY_SUFFIXES .so)
10 IF(WITH_XRANDR AND NOT X11_Xrandr_FOUND)
11 MESSAGE(FATAL_ERROR "Required XRandR extension not found")
13 FIND_PACKAGE(XF86VidMode)
14 FIND_PACKAGE(OpenGL REQUIRED)
15 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
18 FIND_PACKAGE(OpenGL REQUIRED)
21 FILE(GLOB SRC *.cpp *.h *.def *.rc)
24 FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp)
25 SET(SRC ${SRC} ${MAC_SRC})
26 SET_SOURCE_FILES_PROPERTIES(${SRC}
27 PROPERTIES COMPILE_FLAGS "-x objective-c++")
31 SET(NLDRV_OGL_LIB "nel_drv_opengl_win")
33 SET(NLDRV_OGL_LIB "nel_drv_opengl")
36 # This helps to debug issue 310
37 IF(DEBUG_OGL_SPECULAR_FALLBACK)
38 ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK)
40 IF(DEBUG_OGL_COMBINE43_DISABLE)
41 ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE)
44 NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
46 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
48 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY})
49 NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL")
50 NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB})
51 NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB})
54 ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS)
58 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON})
59 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA})
62 IF(UNIX AND NOT APPLE)
63 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_X11_LIB})
65 INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
66 ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
67 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
69 IF(WITH_XRANDR AND X11_Xrandr_FOUND)
70 INCLUDE_DIRECTORIES(${X11_Xrandr_INCLUDE_PATH})
71 ADD_DEFINITIONS(-DHAVE_XRANDR)
72 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrandr_LIB})
75 INCLUDE_DIRECTORIES(${X11_Xrender_INCLUDE_PATH})
76 ADD_DEFINITIONS(-DHAVE_XRENDER)
77 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrender_LIB})
80 INCLUDE_DIRECTORIES(${X11_Xcursor_INCLUDE_PATH})
81 ADD_DEFINITIONS(-DHAVE_XCURSOR)
82 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xcursor_LIB})
85 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xext_LIB})
87 # libraries needed to be linked while linking to static X11 libraries
88 # FIND_LIBRARY(XCB_LIBRARY
90 # HINTS ${X11_LIB_SEARCH_PATH})
92 # TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XCB_LIBRARY})
97 ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp)
100 IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
101 INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d)
103 INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)