2013-01-30 14:53:19 +01:00
cmake_minimum_required ( VERSION 2.8.10.1 )
project ( plasma )
2013-02-07 20:09:05 +01:00
################# Disallow in-source build #################
if ( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" )
message ( FATAL_ERROR "plasma requires an out of source build. Please create a separate build directory and run 'cmake path_to_plasma [options]' there." )
endif ( )
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-01-30 14:53:19 +01:00
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
2013-02-07 23:59:56 +01:00
set ( CMAKE_MODULE_PATH ${ CMAKE_MODULE_PATH } ${ ECM_MODULE_PATH } )
2013-01-30 14:53:19 +01:00
find_package ( Qt5Core REQUIRED NO_MODULE )
find_package ( Qt5Transitional MODULE )
2013-02-07 18:47:01 +01:00
find_package ( Qt5Quick REQUIRED NO_MODULE )
2013-02-10 23:01:46 +01:00
find_package ( Qt5X11Extras REQUIRED NO_MODULE )
2013-03-04 15:46:47 +01:00
find_package ( kde4support REQUIRED NO_MODULE )
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
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 )
################# now find all used packages #################
set ( QT_MIN_VERSION "5.0.0" )
2013-02-07 18:47:01 +01:00
find_package ( kdeqt5staging REQUIRED NO_MODULE )
2013-02-07 20:18:04 +01:00
2013-02-08 22:33:29 +01:00
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
2013-02-09 11:36:57 +01:00
find_package ( KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
2013-05-06 18:01:21 +02:00
X m l G u i K I d l e T i m e I t e m M o d e l s K W i d g e t s A d d o n s K W i n d o w S y s t e m K C o d e c s K A r c h i v e K C o r e A d d o n s S o l i d T h r e a d W e a v e r
2013-05-04 15:14:47 +02:00
K C o n f i g K A u t h k j s
2013-05-08 10:08:26 +02:00
k i 1 8 n k g u i a d d o n s k s e r v i c e k w i d g e t s I t e m V i e w s K N o t i f i c a t i o n s K C o m p l e t i o n K J o b W i d g e t s K C o n f i g W i d g e t s K I c o n T h e m e s )
2013-02-08 00:50:29 +01:00
#find_package(KF5Transitional REQUIRED)
2013-02-07 20:18:04 +01:00
# those are not "done" yet:
find_package ( ki18n REQUIRED NO_MODULE )
2013-02-07 20:09:08 +01:00
find_package ( kio REQUIRED NO_MODULE )
2013-02-09 14:55:12 +01:00
find_package ( kguiaddons REQUIRED NO_MODULE )
2013-02-07 23:59:56 +01:00
2013-02-08 22:33:29 +01:00
find_package ( KDELibs4 REQUIRED NO_MODULE )
2013-02-07 23:59:56 +01:00
2013-02-07 22:12:28 +01:00
find_package ( kdeclarative REQUIRED NO_MODULE )
2013-02-07 18:47:01 +01:00
2013-01-30 14:53:19 +01:00
#optional features
2013-02-08 01:03:29 +01:00
find_package ( X11 MODULE )
2013-01-30 14:53:19 +01:00
if ( X11_FOUND )
2013-02-07 20:09:05 +01:00
set ( HAVE_X11 X11_FOUND )
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-08 01:03:29 +01:00
find_package ( Libintl MODULE )
2013-02-05 22:17:07 +01:00
set_package_properties ( Libintl PROPERTIES DESCRIPTION "Support for multiple languages"
U R L " h t t p : / / w w w . g n u . o r g / s o f t w a r e / g e t t e x t "
T Y P E R E C O M M E N D E D
P U R P O S E " E n a b l e s K D E t o b e a v a i l a b l e i n m a n y d i f f e r e n t l a n g u a g e s "
)
2013-01-30 14:53:19 +01:00
2013-02-05 16:33:51 +01:00
#FIXME: when we have a qca for qt5, reenable
2013-02-08 01:03:29 +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-02-08 01:03:29 +01:00
find_package ( DBusMenuQt MODULE )
2013-01-30 14:53:19 +01:00
set_package_properties ( DBusMenuQt PROPERTIES DESCRIPTION "Support for notification area menus via the DBusMenu protocol"
U R L " h t t p s : / / l a u n c h p a d . n e t / l i b d b u s m e n u - q t "
T Y P E R E Q U I R E D
)
#########################################################################
2013-04-12 11:08:13 +02:00
add_definitions ( ${ KDE4_DEFINITIONS } )
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 ( -DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT )
remove_definitions ( -DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS )
2013-01-30 14:53:19 +01:00
################# setup the include directories #################
2013-02-14 21:28:36 +01:00
include_directories ( ${ kdeqt5staging_INCLUDE_DIRS }
2013-02-18 17:29:22 +01:00
$ { k d e q t 5 s t a g i n g _ I N C L U D E _ D I R }
2013-02-14 20:51:49 +01:00
$ { K D E 4 _ I N C L U D E S }
2013-02-08 00:50:29 +01:00
$ { K F 5 _ I N C L U D E _ D I R S } # since e-c-m 0.0.7
)
2013-01-30 14:53:19 +01:00
# for including config.h and for includes like <kparts/foo.h>
2013-02-14 21:18:16 +01:00
include_directories ( ${ CMAKE_SOURCE_DIR } ${ CMAKE_SOURCE_DIR } /src ${ CMAKE_BINARY_DIR } ${ CMAKE_BINARY_DIR } /src ${ CMAKE_SOURCE_DIR } /interfaces ${ CMAKE_SOURCE_DIR } /src/plasma/includes )
2013-01-30 14:53:19 +01:00
if ( QCA2_FOUND )
include_directories (
$ { Q C A 2 _ I N C L U D E _ D I R }
)
2013-02-08 00:56:43 +01:00
endif ( )
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-02-08 00:56:43 +01:00
macro ( installPackage dir component )
2013-04-25 02:08:47 +02:00
set ( root ${ ARGV2 } )
set ( type ${ ARGV3 } )
2013-02-08 00:56:43 +01:00
if ( NOT root )
set ( root plasma/plasmoids )
endif ( )
2013-04-25 02:08:47 +02:00
if ( NOT type )
set ( type applet )
endif ( )
2013-04-27 03:06:58 +02:00
install ( DIRECTORY ${ dir } / DESTINATION ${ DATA_INSTALL_DIR } / ${ root } / ${ component } PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE )
2013-04-25 02:08:47 +02:00
install ( FILES ${ dir } /metadata.desktop DESTINATION ${ SERVICES_INSTALL_DIR } RENAME plasma- ${ type } - ${ component } .desktop )
2013-02-08 00:56:43 +01:00
endmacro ( )
2013-02-04 16:48:37 +01:00
2013-01-30 14:53:19 +01:00
################# list the subdirectories #################
2013-02-14 17:17:12 +01:00
add_subdirectory ( src )
2013-01-31 11:33:51 +01:00
add_subdirectory ( desktoptheme )
2013-01-30 14:53:19 +01:00
feature_summary ( WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES )