Fixed: #849 CMake now finds XF86VidMode and links OpenGL correctly.

This commit is contained in:
Matt Raykowski 2010-05-12 11:49:59 -05:00
parent e4653bbde9
commit cd7af53bc8
3 changed files with 56 additions and 1 deletions

View file

@ -91,6 +91,9 @@ IF(WITH_3D)
IF(WITH_DRIVER_OPENGL)
FIND_PACKAGE(OpenGL)
IF(NOT WIN32)
FIND_PACKAGE(XF86VidMode)
ENDIF(NOT WIN32)
ENDIF(WITH_DRIVER_OPENGL)
IF(WITH_CEGUI)

View file

@ -0,0 +1,46 @@
# - Locate Jpeg library
# This module defines
# XF86VidMode_LIBRARY, the library to link against
# XF86VidMode_FOUND, if false, do not try to link to XF86VidMode
# XF86VidMode_INCLUDE_DIR, where to find headers.
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
# in cache already
SET(XF86VidMode_FIND_QUIETLY TRUE)
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
FIND_PATH(XF86VidMode_INCLUDE_DIR
xf86vm.h
PATHS
$ENV{XF86VidMode_DIR}/include
/usr/include/X11/
/usr/X11R6/include/
PATH_SUFFIXES extensions
)
FIND_LIBRARY(XF86VidMode_LIBRARY
Xxf86vm
PATHS
$ENV{XF86VidMode_DIR}/lib
/usr/X11R6/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
SET(XF86VidMode_FOUND "YES")
SET(XF86VidMode_DEFINITIONS -DXF86VIDMODE)
IF(NOT XF86VidMode_FIND_QUIETLY)
MESSAGE(STATUS "Found XF86VidMode: ${XF86VidMode_LIBRARY}")
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ELSE(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
IF(NOT XF86VidMode_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find XF86VidMode!")
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)

View file

@ -24,6 +24,12 @@ IF(WIN32)
RELEASE_POSTFIX "_r"
LINK_FLAGS "/NODEFAULTLIB:libcmt")
ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS)
ELSE(WIN32)
IF(XF86VidMode_FOUND)
INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR})
ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS})
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY})
ENDIF(XF86VidMode_FOUND)
ENDIF(WIN32)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
@ -31,4 +37,4 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
ENDIF(WITH_MAXPLUGIN)
ENDIF(WITH_MAXPLUGIN)