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 FIND_PACKAGE(XF86VidMode)
11 FIND_PACKAGE(OpenGL REQUIRED)
12 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
15 FIND_PACKAGE(OpenGL REQUIRED)
18 FILE(GLOB SRC *.cpp *.h *.def *.rc)
21 FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp)
22 SET(SRC ${SRC} ${MAC_SRC})
23 SET_SOURCE_FILES_PROPERTIES(${SRC}
24 PROPERTIES COMPILE_FLAGS "-x objective-c++")
28 SET(NLDRV_OGL_LIB "nel_drv_opengl_win")
30 SET(NLDRV_OGL_LIB "nel_drv_opengl")
33 # This helps to debug issue 310
34 IF(DEBUG_OGL_SPECULAR_FALLBACK)
35 ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK)
37 IF(DEBUG_OGL_COMBINE43_DISABLE)
38 ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE)
41 NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
43 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
45 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY})
46 NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL")
47 NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB})
48 NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB})
51 ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS)
55 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON})
56 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA})
59 IF(UNIX AND NOT APPLE)
60 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_X11_LIB})
62 INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
63 ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
64 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
67 INCLUDE_DIRECTORIES(${X11_Xrandr_INCLUDE_PATH})
68 ADD_DEFINITIONS(-DHAVE_XRANDR)
69 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrandr_LIB})
72 INCLUDE_DIRECTORIES(${X11_Xrender_INCLUDE_PATH})
73 ADD_DEFINITIONS(-DHAVE_XRENDER)
74 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrender_LIB})
77 INCLUDE_DIRECTORIES(${X11_Xcursor_INCLUDE_PATH})
78 ADD_DEFINITIONS(-DHAVE_XCURSOR)
79 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xcursor_LIB})
82 TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xext_LIB})
84 # libraries needed to be linked while linking to static X11 libraries
85 # FIND_LIBRARY(XCB_LIBRARY
87 # HINTS ${X11_LIB_SEARCH_PATH})
89 # TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XCB_LIBRARY})
94 ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp)
97 IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
98 INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d)
100 INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)