project( kcometen4.kss )

find_package( KDE4 REQUIRED )

set( CMAKE_VERBOSE_MAKEFILE TRUE )
set( CMAKE_INCLUDE_CURRENT_DIR TRUE )
set( QT_USE_OPENGL TRUE )

include( ${QT_USE_FILE} )

add_definitions( ${QT_DEFINITIONS} ${KDE4_DEFINITIONS} )

link_directories( ${KDE4_LIB_DIR} )

if ( QT_QTOPENGL_FOUND )
    message( "-- Found QtOpenGL: ${QT_QTOPENGL_LIBRARY}")
else ( QT_QTOPENGL_FOUND )
    message( FATAL_ERROR "\nQtOpenGL could not be found.\nOn Debian-based systems, this is in libqt4-opengl-dev.\n")
endif ( QT_QTOPENGL_FOUND )

if ( QT_QTOPENGL_INCLUDE_DIR )
    message( "-- Found QtOpenGL includes: ${QT_QTOPENGL_INCLUDE_DIR}")
else ( QT_QTOPENGL_INCLUDE_DIR )
    message( FATAL_ERROR "\nQtOpenGL includes could not be found.\nOn Debian-based systems, this is in libqt4-opengl-dev.\n")
endif ( QT_QTOPENGL_INCLUDE_DIR )

find_path( KSCREENSAVER_INCLUDE_DIR kscreensaver.h ${KDE4_INCLUDE_DIR} )
IF( KSCREENSAVER_INCLUDE_DIR )
    message( "-- Found KScreenSaver include: ${KDE4_INCLUDE_DIR}/kscreensaver.h" )
else( KSCREENSAVER_INCLUDE_DIR )
	message( FATAL_ERROR "\nkscreensaver.h could not be found.\nOn Debian-based systems, this is in kdebase-workspace-dev.\n" )
endif( KSCREENSAVER_INCLUDE_DIR )

add_subdirectory( src )
