Add optional opengl support

pull/2/head
Alexander Golubev 11 years ago committed by Slávek Banko
parent d1a487948a
commit 440db91f91

@ -28,6 +28,7 @@ include( CheckCXXSourceRuns )
include( CheckCXXSourceCompiles ) include( CheckCXXSourceCompiles )
include( CheckLibraryExists ) include( CheckLibraryExists )
include( CheckFunctionExists ) include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckStructHasMember ) include( CheckStructHasMember )
include( CheckTypeSize ) include( CheckTypeSize )
@ -70,6 +71,7 @@ option( WITH_XRENDER "Enable xrender support" ${WITH_ALL_OPTIONS} )
option( WITH_XDAMAGE "Enable xdamage support" ${WITH_ALL_OPTIONS} ) option( WITH_XDAMAGE "Enable xdamage support" ${WITH_ALL_OPTIONS} )
option( WITH_XEXT "Enable xext support" ${WITH_ALL_OPTIONS} ) option( WITH_XEXT "Enable xext support" ${WITH_ALL_OPTIONS} )
option( WITH_XTEST "Enable xtest support" ${WITH_ALL_OPTIONS} ) option( WITH_XTEST "Enable xtest support" ${WITH_ALL_OPTIONS} )
option( WITH_OPENGL "Enable openGL support" ${WITH_ALL_OPTIONS} )
option( WITH_XSCREENSAVER "Enable xscreensaver support" ${WITH_ALL_OPTIONS} ) option( WITH_XSCREENSAVER "Enable xscreensaver support" ${WITH_ALL_OPTIONS} )
option( WITH_LIBART "Enable libart support (for SVG icons and wallpapers)" ${WITH_ALL_OPTIONS} ) option( WITH_LIBART "Enable libart support (for SVG icons and wallpapers)" ${WITH_ALL_OPTIONS} )
option( WITH_LIBUSB "Enable control of some mouse models through libusb" ${WITH_ALL_OPTIONS} ) option( WITH_LIBUSB "Enable control of some mouse models through libusb" ${WITH_ALL_OPTIONS} )

@ -168,12 +168,29 @@ if( WITH_XSCREENSAVER )
endif( ) endif( )
# GL # openGL (kdesktop or kcontrol or tdescreensaver )
if( BUILD_KDESKTOP OR BUILD_KCONTROL OR BUILD_TDESCREENSAVER ) if( WITH_OPENGL )
check_library_exists( GL glXChooseVisual "" HAVE_GLXCHOOSEVISUAL ) pkg_search_module( GL gl )
if( HAVE_GLXCHOOSEVISUAL ) if( GL_FOUND )
set( GL_LIBRARY "GL" ) # some extra check, stricktly speaking they are not necessary
tde_save( CMAKE_REQUIRED_LIBRARIES )
set( CMAKE_REQUIRED_LIBRARIES ${GL_LIBRARIES} )
check_symbol_exists( glXChooseVisual "GL/glx.h" HAVE_GLXCHOOSEVISUAL )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
if( NOT HAVE_GLXCHOOSEVISUAL )
tde_message_fatal( "opengl is requested and found, but it doesn't provides glXChooseVisual() or GL/glx.h" )
endif( )
else( )
tde_message_fatal( "opengl is requested, but not found on your system" )
endif( ) endif( )
if( BUILD_KCONTROL )
pkg_search_module( GLU glu )
if( NOT GLU_FOUND )
tde_message_fatal( "glu is required, but not found on your system" )
endif( )
endif( BUILD_KCONTROL )
endif( ) endif( )

@ -9,8 +9,6 @@
# #
################################################# #################################################
# FIXME no OPENGL support yet
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
@ -22,20 +20,27 @@ link_directories(
${TQT_LIBRARY_DIRS} ${TQT_LIBRARY_DIRS}
) )
if( WITH_OPENGL )
add_definitions( -DINFO_OPENGL_AVAILABLE )
set( OPENGL_DESKTOP opengl.desktop )
set( OPENGL_SOURCES opengl.cpp )
endif( WITH_OPENGL )
##### other data ################################ ##### other data ################################
install( FILES install( FILES
memory.desktop processor.desktop dma.desktop memory.desktop processor.desktop dma.desktop
interrupts.desktop ioports.desktop opengl.desktop interrupts.desktop ioports.desktop pci.desktop
pci.desktop sound.desktop devices.desktop scsi.desktop sound.desktop devices.desktop scsi.desktop
partitions.desktop xserver.desktop cdinfo.desktop partitions.desktop xserver.desktop cdinfo.desktop
${OPENGL_DESKTOP}
DESTINATION ${XDG_APPS_INSTALL_DIR} ) DESTINATION ${XDG_APPS_INSTALL_DIR} )
##### kcm_info (module) ######################### ##### kcm_info (module) #########################
tde_add_kpart( kcm_info AUTOMOC tde_add_kpart( kcm_info AUTOMOC
SOURCES main.cpp memory.cpp opengl.cpp SOURCES main.cpp memory.cpp ${OPENGL_SOURCES}
LINK tdeui-shared LINK tdeui-shared ${GL_LIBRARIES} ${GLU_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR} DESTINATION ${PLUGIN_INSTALL_DIR}
) )

@ -1,5 +1,5 @@
[Desktop Entry] [Desktop Entry]
NoDisplay=true # NoDisplay=true
Exec=tdecmshell opengl Exec=tdecmshell opengl
Icon=kcmopengl Icon=kcmopengl
Type=Application Type=Application
@ -8,7 +8,7 @@ DocPath=kinfocenter/opengl/index.html
X-TDE-Library=info X-TDE-Library=info
X-TDE-FactoryName=opengl X-TDE-FactoryName=opengl
X-TDE-ParentApp=kcontrol X-TDE-ParentApp=kinfocenter
Name=OpenGL Name=OpenGL
Name[bn]=ওপেন-জি-এল Name[bn]=ওপেন-জি-এল

@ -32,6 +32,6 @@ tde_add_kpart( kcm_screensaver AUTOMOC
advanceddialogimpl.ui scrnsave.cpp testwin.cpp advanceddialogimpl.ui scrnsave.cpp testwin.cpp
saverlist.cpp saverconfig.cpp advanceddialog.cpp saverlist.cpp saverconfig.cpp advanceddialog.cpp
kswidget.cpp kswidget.cpp
LINK tdeio-shared ${GL_LIBRARY} LINK tdeio-shared ${GL_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR} DESTINATION ${PLUGIN_INSTALL_DIR}
) )

@ -38,6 +38,6 @@ set( ${target}_SRCS
tde_add_executable( ${target} AUTOMOC tde_add_executable( ${target} AUTOMOC
SOURCES ${${target}_SRCS} SOURCES ${${target}_SRCS}
LINK kdesktopsettings-static dmctl-static tdeio-shared Xext LINK kdesktopsettings-static dmctl-static tdeio-shared Xext
${GL_LIBRARY} "${LINKER_IMMEDIATE_BINDING_FLAGS}" ${GL_LIBRARIES} "${LINKER_IMMEDIATE_BINDING_FLAGS}"
DESTINATION ${BIN_INSTALL_DIR} DESTINATION ${BIN_INSTALL_DIR}
) )

@ -30,7 +30,7 @@ install( FILES KRandom.desktop KBlankscreen.desktop DESTINATION ${APPS_INSTALL_D
tde_add_executable( krandom.kss AUTOMOC tde_add_executable( krandom.kss AUTOMOC
SOURCES random.cpp SOURCES random.cpp
LINK tdeui-shared ${GL_LIBRARY} LINK tdeui-shared ${GL_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR} DESTINATION ${BIN_INSTALL_DIR}
) )

@ -92,7 +92,7 @@ bool hasDirectRendering () {
return false; return false;
} }
#else #else
#error no GL? // no GL
return false; return false;
#endif #endif

Loading…
Cancel
Save