Show bonus/malus timer text if available
[ryzomcore.git] / nel / src / 3d / driver / opengl / CMakeLists.txt
blob8b5aabeb19146bbed09b936f7661e3396d5cdaf3
1 IF(NOT WIN32)
2   IF(APPLE)
3     FIND_LIBRARY(CARBON NAMES Carbon)
4     FIND_LIBRARY(COCOA NAMES Cocoa)
5     FIND_PACKAGE(OpenGL REQUIRED)
6   ELSE()
7     SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
8     SET(CMAKE_FIND_LIBRARY_SUFFIXES .so)
9     FIND_PACKAGE(X11)
10     FIND_PACKAGE(XF86VidMode)
11     FIND_PACKAGE(OpenGL REQUIRED)
12     SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
13   ENDIF()
14 ELSE()
15   FIND_PACKAGE(OpenGL REQUIRED)
16 ENDIF()
18 FILE(GLOB SRC *.cpp *.h *.def *.rc)
20 IF(APPLE)
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++")
25 ENDIF()
27 IF(WIN32)
28   SET(NLDRV_OGL_LIB "nel_drv_opengl_win")
29 ELSE()
30   SET(NLDRV_OGL_LIB "nel_drv_opengl")
31 ENDIF()
33 # This helps to debug issue 310
34 IF(DEBUG_OGL_SPECULAR_FALLBACK)
35   ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK)
36 ENDIF()
37 IF(DEBUG_OGL_COMBINE43_DISABLE)
38   ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE)
39 ENDIF()
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})
50 IF(WIN32)
51   ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS)
52 ENDIF()
54 IF(APPLE)
55   TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON})
56   TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA})
57 ENDIF()
59 IF(UNIX AND NOT APPLE)
60   TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_X11_LIB})
61   IF(XF86VidMode_FOUND)
62     INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
63     ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
64     TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
65   ENDIF()
66   IF(X11_Xrandr_FOUND)
67     INCLUDE_DIRECTORIES(${X11_Xrandr_INCLUDE_PATH})
68     ADD_DEFINITIONS(-DHAVE_XRANDR)
69     TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrandr_LIB})
70   ENDIF()
71   IF(X11_Xrender_FOUND)
72     INCLUDE_DIRECTORIES(${X11_Xrender_INCLUDE_PATH})
73     ADD_DEFINITIONS(-DHAVE_XRENDER)
74     TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xrender_LIB})
75   ENDIF()
76   IF(X11_Xcursor_FOUND)
77     INCLUDE_DIRECTORIES(${X11_Xcursor_INCLUDE_PATH})
78     ADD_DEFINITIONS(-DHAVE_XCURSOR)
79     TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xcursor_LIB})
80   ENDIF()
81   IF(X11_Xext_FOUND)
82     TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xext_LIB})
83   ENDIF()
84   # libraries needed to be linked while linking to static X11 libraries
85 #  FIND_LIBRARY(XCB_LIBRARY
86 #    NAMES xcb
87 #    HINTS ${X11_LIB_SEARCH_PATH})
88 #  IF(XCB_LIBRARY)
89 #    TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XCB_LIBRARY})
90 #  ENDIF()
91 ENDIF()
93 IF(WITH_PCH)
94   ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp)
95 ENDIF()
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)
99   IF(WITH_MAXPLUGIN)
100     INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
101   ENDIF()
102 ENDIF()