summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authoraneejit1 <[email protected]>2020-06-17 21:45:21 +0000
committeraneejit1 <[email protected]>2020-06-19 16:11:20 +0000
commit7fba97e18aa453c76130f587740f692cd267a216 (patch)
tree42dc1d38636245e29b5e6f305056a47be4a63d2e /ConfigureChecks.cmake
parent92902053e5ea081619e14eb5b1fc5d527e4f6136 (diff)
downloadtdebase-7fba97e18aa453c76130f587740f692cd267a216.tar.gz
tdebase-7fba97e18aa453c76130f587740f692cd267a216.zip
Improve detection of libXss, OpenGL and libXext DPMS support.
The detection of libXss has been changed to ask the question "where is libXss?" before asking "is XScreenSaverQueryInfo available?" rather than the other way around. The test for "XScreenSaverQueryInfo" also ensures that the include and library flags from pkg-config are used. The OpenGL test has been amended to make use of the include paths and library flags returned by pkg-config to prevent the test from failing when OpenGL is not in /usr. The libXext test in kcontrol/energy/CMakeLists.txt is amended to use the libXext include path and library flags. The paths are also added to the include/link directories. Signed-off-by: aneejit1 <[email protected]>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake25
1 files changed, 18 insertions, 7 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 1e38dd672..64908c9da 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -265,11 +265,18 @@ endif( )
# xscreensaver ()
if( WITH_XSCREENSAVER )
- check_library_exists( Xss XScreenSaverQueryInfo "" HAVE_XSSLIB )
- if( HAVE_XSSLIB )
- pkg_search_module( XSS xscrnsaver )
- else( )
- check_library_exists( Xext XScreenSaverQueryInfo "" HAVE_XEXT_XSS )
+ pkg_search_module( XSS xscrnsaver )
+
+ if( XSS_FOUND )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${XSS_INCLUDE_DIRS}" )
+ check_library_exists( Xss XScreenSaverQueryInfo "${XSS_LIBRARY_DIRS}" HAVE_XSSLIB )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+ else( XSS_FOUND )
+ check_library_exists( Xss XScreenSaverQueryInfo "" HAVE_XSSLIB )
+ endif( XSS_FOUND )
+
+ if( NOT HAVE_XSSLIB )
+ check_library_exists( Xext XScreenSaverQueryInfo "${XEXT_LIBRARY_DIRS}" HAVE_XEXT_XSS )
if( HAVE_XEXT_XSS )
set( HAVE_XSSLIB 1 )
pkg_search_module( XSS xext )
@@ -293,6 +300,7 @@ if( WITH_XSCREENSAVER )
You have to either specify it manually with e.g. -DXSCREENSAVER_DIR=/usr/lib/misc/xscreensaver/
or make sure that xscreensaver installed properly" )
endif( )
+
endif( )
@@ -301,10 +309,13 @@ if( WITH_OPENGL )
pkg_search_module( GL gl )
if( GL_FOUND )
# some extra check, stricktly speaking they are not necessary
- tde_save( CMAKE_REQUIRED_LIBRARIES )
- set( CMAKE_REQUIRED_LIBRARIES ${GL_LIBRARIES} )
+ tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${GL_LIBRARIES} )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${GL_INCLUDE_DIRS}" )
+ tde_save_and_set( CMAKE_REQUIRED_FLAGS "${GL_LDFLAGS}" )
check_symbol_exists( glXChooseVisual "GL/glx.h" HAVE_GLXCHOOSEVISUAL )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+ tde_restore( CMAKE_REQUIRED_FLAGS )
if( NOT HAVE_GLXCHOOSEVISUAL )
tde_message_fatal( "opengl is requested and found, but it doesn't provides glXChooseVisual() or GL/glx.h" )
endif( )