summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ConfigureChecks.cmake25
-rw-r--r--kcontrol/energy/CMakeLists.txt7
2 files changed, 24 insertions, 8 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( )
diff --git a/kcontrol/energy/CMakeLists.txt b/kcontrol/energy/CMakeLists.txt
index 9e194602a..b9f2f9958 100644
--- a/kcontrol/energy/CMakeLists.txt
+++ b/kcontrol/energy/CMakeLists.txt
@@ -16,6 +16,8 @@ if( WITH_DPMS )
include( CheckCSourceCompiles )
set( CMAKE_REQUIRED_LIBRARIES Xext )
+ set( CMAKE_REQUIRED_INCLUDES "${XEXT_INCLUDE_DIRS}" )
+ set( CMAKE_REQUIRED_FLAGS "${XEXT_LDFLAGS}" )
check_c_source_compiles("
#include <sys/types.h>
@@ -45,10 +47,12 @@ include_directories(
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
+ ${XEXT_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
+ ${XEXT_LIBRARY_DIRS}
)
##### other data ################################
@@ -60,6 +64,7 @@ install( FILES energy.desktop DESTINATION ${APPS_INSTALL_DIR}/.hidden )
tde_add_kpart( kcm_energy AUTOMOC
SOURCES energy.cpp
- LINK tdeio-shared ${XEXT_LIBRARY}
+ LINK tdeio-shared
+ LINK_PRIVATE ${XEXT_LIBRARY}
DESTINATION ${PLUGIN_INSTALL_DIR}
)