2013-06-30 11:16:02 +02:00
cmake_minimum_required ( VERSION 2.8.11 )
2013-01-30 14:53:19 +01:00
2013-10-22 00:40:17 +02:00
project ( Plasma )
2013-02-07 20:09:05 +01:00
2013-01-30 14:53:19 +01:00
# Make CPack available to easy generate binary packages
include ( CPack )
2013-02-07 20:09:05 +01:00
include ( FeatureSummary )
2013-01-30 14:53:19 +01:00
################# set KDE specific information #################
2013-02-27 20:06:18 +01:00
find_package ( ECM 0.0.8 REQUIRED NO_MODULE )
2013-10-31 09:30:24 +01:00
set ( CMAKE_MODULE_PATH ${ ECM_MODULE_PATH } ${ ECM_KDE_MODULE_DIR } )
include ( KDEInstallDirs )
include ( KDECMakeSettings )
include ( KDECompilerSettings )
2013-01-30 14:53:19 +01:00
2013-04-12 11:08:13 +02:00
add_definitions ( -DQT_DISABLE_DEPRECATED_BEFORE=0 )
2013-01-30 14:53:19 +01:00
2013-07-08 00:15:37 +02:00
#add_definitions(-Wno-deprecated)
2013-01-30 14:53:19 +01:00
if ( KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED )
set ( KDE_NO_DEPRECATED TRUE )
set ( CMAKE_AUTOMOC_MOC_OPTIONS "-DKDE_NO_DEPRECATED" )
2013-02-08 00:56:43 +01:00
endif ( )
2013-01-30 14:53:19 +01:00
############### Load the CTest options ###############
# CTestCustom.cmake has to be in the CTEST_BINARY_DIR.
# in the KDE build system, this is the same as CMAKE_BINARY_DIR.
configure_file ( ${ CMAKE_SOURCE_DIR } /CTestCustom.cmake ${ CMAKE_BINARY_DIR } /CTestCustom.cmake COPYONLY )
2013-09-11 11:15:29 +02:00
################# Enable C++0x (still too early for -std=c++11) features for clang and gcc #################
2013-06-23 10:22:37 +02:00
if ( UNIX )
2013-08-26 21:22:06 +02:00
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
add_definitions ( "-Wall -std=c++0x" )
2013-06-23 10:22:37 +02:00
endif ( )
2013-01-30 14:53:19 +01:00
################# now find all used packages #################
2013-06-21 01:38:28 +02:00
set ( QT_MIN_VERSION "5.2.0" )
2013-01-30 14:53:19 +01:00
2013-11-03 00:28:30 +01:00
find_package ( Qt5 REQUIRED NO_MODULE COMPONENTS Quick X11Extras Sql UiTools Qml Widgets Svg Declarative Script Test PrintSupport )
2013-10-22 00:40:17 +02:00
2013-12-11 14:01:52 +01:00
find_package ( KF5 CONFIG REQUIRED IdleTime ItemModels WidgetsAddons WindowSystem Codecs Archive CoreAddons Solid ThreadWeaver GlobalAccel
C o n f i g A u t h J S W a l l e t D B u s A d d o n s I 1 8 n G u i A d d o n s C o n f i g W i d g e t s
S e r v i c e I t e m V i e w s N o t i f i c a t i o n s I c o n T h e m e s C o m p l e t i o n J o b W i d g e t s S o n n e t T e x t W i d g e t s X m l G u i C r a s h
2013-12-19 15:23:00 +01:00
B o o k m a r k s D e c l a r a t i v e U n i t C o n v e r s i o n P a r t s K r o s s K I O D N S S D K D E 4 S u p p o r t )
2013-11-26 08:13:27 +01:00
find_package ( KActivities )
set_package_properties ( KActivities PROPERTIES DESCRIPTION "The KActivities library"
U R L " h t t p s : / / p r o j e c t s . k d e . o r g / k a c t i v i t i e s "
T Y P E R E Q U I R E D
)
2013-10-23 15:45:25 +02:00
2013-01-30 14:53:19 +01:00
#optional features
2013-02-08 01:03:29 +01:00
find_package ( X11 MODULE )
2013-10-21 15:52:48 +02:00
find_package ( XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE )
2013-09-04 07:14:24 +02:00
set_package_properties ( XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
U R L " h t t p : / / x c b . f r e e d e s k t o p . o r g "
2013-10-21 15:52:48 +02:00
T Y P E R E Q U I R E D
2013-09-04 07:14:24 +02:00
)
if ( X11_FOUND AND XCB_XCB_FOUND )
set ( HAVE_X11 1 )
2013-01-30 14:53:19 +01:00
#X11_Xrender discovery is done by FindX11
add_feature_info ( "X Rendering Extension (libXrender)" X11_Xrender_FOUND "Support for compositing, rendering operations, and alpha-blending. STRONGLY RECOMMENDED" )
2013-02-07 20:09:05 +01:00
add_feature_info ( "X Screensaver Extension (libXss)" X11_Xscreensaver_FOUND "Support for KIdleTime (fallback mode)" )
add_feature_info ( "X Sync Extension (libXext)" X11_XSync_FOUND "Efficient operation of KIdleTime. STRONGLY RECOMMENDED" )
2013-01-30 14:53:19 +01:00
2013-02-07 20:09:05 +01:00
if ( NOT X11_XSync_FOUND AND NOT X11_Xscreensaver_FOUND )
2013-01-30 14:53:19 +01:00
message ( FATAL_ERROR "\nNeither the XSync (libXext) nor XScreensaver (libXss) development package was found.\nPlease install one of them (XSync is recommended)\n" )
2013-02-07 20:09:05 +01:00
endif ( )
2013-01-30 14:53:19 +01:00
#X11 Session Management (SM) is required
#X11_SM_FOUND is set in FindX11, which is required by KDE4Internal
if ( UNIX AND NOT X11_SM_FOUND )
message ( FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n" )
2013-02-08 00:56:43 +01:00
endif ( )
endif ( )
2013-01-30 14:53:19 +01:00
2013-02-08 01:03:29 +01:00
find_package ( OpenSSL MODULE )
2013-02-05 22:17:07 +01:00
set_package_properties ( OpenSSL PROPERTIES DESCRIPTION "Support for secure network communications (SSL and TLS)"
U R L " h t t p : / / o p e n s s l . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " K D E u s e s O p e n S S L f o r t h e b u l k o f s e c u r e c o m m u n i c a t i o n s , i n c l u d i n g s e c u r e w e b b r o w s i n g v i a H T T P S "
)
2013-02-05 16:33:51 +01:00
#FIXME: when we have a qca for qt5, reenable
2013-11-11 18:40:19 +01:00
# find_package(QCA2 2.0.0 MODULE)
2013-02-05 22:17:07 +01:00
set_package_properties ( QCA2 PROPERTIES DESCRIPTION "Support for remote plasma widgets"
U R L " h t t p : / / d e l t a . a f f i n i x . c o m / q c a "
T Y P E O P T I O N A L
)
2013-01-30 14:53:19 +01:00
2013-07-26 18:01:10 +02:00
#find_package(DBusMenuQt MODULE)
#set_package_properties(DBusMenuQt PROPERTIES DESCRIPTION "Support for notification area menus via the DBusMenu protocol"
#URL "https://launchpad.net/libdbusmenu-qt"
#TYPE REQUIRED
#)
2013-01-30 14:53:19 +01:00
2013-07-14 18:17:30 +02:00
# TODO remove it in future
find_package ( LibAttica NO_MODULE )
set_package_properties ( LibAttica PROPERTIES DESCRIPTION "Support for Get Hot New Stuff related stuff"
U R L " h t t p s : / / p r o j e c t s . k d e . o r g / a t t i c a "
T Y P E R E Q U I R E D
)
2013-08-18 10:01:44 +02:00
find_package ( OpenGL )
set_package_properties ( OpenGL PROPERTIES DESCRIPTION "The OpenGL libraries"
U R L " h t t p : / / w w w . o p e n g l . o r g "
T Y P E O P T I O N A L
)
if ( OPENGL_FOUND )
2013-10-22 00:40:17 +02:00
set ( HAVE_GLX ${ HAVE_X11 } )
2013-08-18 10:01:44 +02:00
else ( )
set ( HAVE_GLX 0 )
endif ( )
2013-01-30 14:53:19 +01:00
#########################################################################
add_definitions ( -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS )
add_definitions ( -DQT_NO_URL_CAST_FROM_STRING )
2013-02-08 00:50:29 +01:00
remove_definitions ( -DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS )
2013-12-11 13:53:09 +01:00
include ( KF5PlasmaMacros.cmake )
2013-01-30 14:53:19 +01:00
################# configure checks and create the configured files #################
# now create config headers
configure_file ( config-prefix.h.cmake ${ CMAKE_CURRENT_BINARY_DIR } /config-prefix.h )
configure_file ( config-compiler.h.cmake ${ CMAKE_CURRENT_BINARY_DIR } /config-compiler.h )
2013-05-03 01:14:19 +02:00
################ create PlasmaConfig.cmake and install it ###########################
# create a Config.cmake and a ConfigVersion.cmake file and install them
2013-12-11 13:53:09 +01:00
set ( CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Plasma" )
2013-05-03 01:14:19 +02:00
include ( CMakePackageConfigHelpers )
include ( ECMSetupVersion )
2013-10-01 13:46:17 +02:00
ecm_setup_version ( 2.0.0 VARIABLE_PREFIX PLASMA
2013-05-03 01:14:19 +02:00
V E R S I O N _ H E A D E R " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / p l a s m a _ v e r s i o n . h "
2013-12-11 13:53:09 +01:00
P A C K A G E _ V E R S I O N _ F I L E " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / K F 5 P l a s m a C o n f i g V e r s i o n . c m a k e " )
2013-05-03 01:14:19 +02:00
configure_package_config_file (
2013-12-11 13:53:09 +01:00
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / K F 5 P l a s m a C o n f i g . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / K F 5 P l a s m a C o n f i g . c m a k e "
2013-05-03 01:14:19 +02:00
I N S T A L L _ D E S T I N A T I O N $ { C M A K E C O N F I G _ I N S T A L L _ D I R }
P A T H _ V A R S I N C L U D E _ I N S T A L L _ D I R C M A K E _ I N S T A L L _ P R E F I X
)
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /plasma_version.h
D E S T I N A T I O N $ { I N C L U D E _ I N S T A L L _ D I R } C O M P O N E N T D e v e l )
install ( FILES
2013-12-11 13:53:09 +01:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / K F 5 P l a s m a C o n f i g . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / K F 5 P l a s m a C o n f i g V e r s i o n . c m a k e "
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / K F 5 P l a s m a M a c r o s . c m a k e "
2013-05-03 01:14:19 +02:00
D E S T I N A T I O N " $ { C M A K E C O N F I G _ I N S T A L L _ D I R } "
C O M P O N E N T D e v e l
)
2013-06-13 01:43:35 +02:00
2013-01-30 14:53:19 +01:00
################# list the subdirectories #################
2013-05-03 03:16:07 +02:00
add_subdirectory ( src )
2013-09-04 11:34:00 +02:00
add_subdirectory ( desktoptheme )
add_subdirectory ( examples )
2013-01-30 14:53:19 +01:00
2013-12-11 13:53:09 +01:00
install ( EXPORT KF5PlasmaTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5PlasmaTargets.cmake NAMESPACE KF5:: COMPONENT Devel )
2013-01-30 14:53:19 +01:00
feature_summary ( WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES )