mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-17 22:48:44 +00:00
61 lines
2.3 KiB
CMake
61 lines
2.3 KiB
CMake
FILE(GLOB SRC *.cpp *.h *.def)
|
|
IF(WITH_COCOA)
|
|
FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp)
|
|
SET(SRC ${SRC} ${MAC_SRC})
|
|
ENDIF(WITH_COCOA)
|
|
|
|
IF(WIN32)
|
|
SET(NLDRV_OGL_LIB "nel_drv_opengl_win")
|
|
ELSE(WIN32)
|
|
SET(NLDRV_OGL_LIB "nel_drv_opengl")
|
|
ENDIF(WIN32)
|
|
|
|
NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
|
|
|
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES})
|
|
NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "Driver, Video: OpenGL")
|
|
NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB})
|
|
NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB})
|
|
|
|
IF(WIN32)
|
|
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY})
|
|
ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS)
|
|
ELSE(WIN32)
|
|
IF(APPLE)
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON})
|
|
IF(WITH_COCOA)
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA})
|
|
ELSE(WITH_COCOA)
|
|
# 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.
|
|
INCLUDE_DIRECTORIES("/usr/X11/include")
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB}
|
|
"-L/usr/X11/lib" "-lGL" ${X11_LIBRARIES})
|
|
ENDIF(WITH_COCOA)
|
|
ELSE(APPLE)
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES})
|
|
IF(XF86VidMode_FOUND)
|
|
INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
|
|
ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
|
|
ENDIF(XF86VidMode_FOUND)
|
|
IF(XRandR_FOUND)
|
|
INCLUDE_DIRECTORIES(${XRandR_INCLUDE_DIR})
|
|
ADD_DEFINITIONS(${XRandR_DEFINITIONS})
|
|
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XRandR_LIBRARY})
|
|
ENDIF(XRandR_FOUND)
|
|
ENDIF(APPLE)
|
|
ENDIF(WIN32)
|
|
|
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
|
|
|
|
IF(NOT WITH_COCOA AND WITH_PCH)
|
|
ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp)
|
|
ENDIF(NOT WITH_COCOA AND WITH_PCH)
|
|
|
|
INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
|
|
IF(WITH_MAXPLUGIN)
|
|
INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
|
|
ENDIF(WITH_MAXPLUGIN)
|