2014-02-08 12:30:02 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
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
|
|
|
|
2014-04-26 02:00:16 +02:00
|
|
|
# ECM setup
|
2014-12-31 15:26:44 +01:00
|
|
|
find_package(ECM 1.6.0 REQUIRED NO_MODULE)
|
2013-10-31 09:30:24 +01:00
|
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
|
|
|
|
|
2014-04-26 02:00:16 +02:00
|
|
|
include(FeatureSummary)
|
|
|
|
include(GenerateExportHeader)
|
2014-03-17 16:28:24 +01:00
|
|
|
include(ECMGenerateHeaders)
|
2013-10-31 09:30:24 +01:00
|
|
|
include(KDEInstallDirs)
|
|
|
|
include(KDECMakeSettings)
|
|
|
|
include(KDECompilerSettings)
|
2014-04-26 02:00:16 +02:00
|
|
|
include(ECMPackageConfigHelpers)
|
|
|
|
include(ECMSetupVersion)
|
2014-05-19 16:58:37 +02:00
|
|
|
include(KDEFrameworkCompilerSettings)
|
2014-04-26 02:00:16 +02:00
|
|
|
|
2015-01-08 23:45:13 +01:00
|
|
|
set(KF5_VERSION "5.7.0") # handled by release scripts
|
2014-12-31 15:26:44 +01:00
|
|
|
set(KF5_DEP_VERSION "5.6.0") # handled by release scripts
|
2014-04-26 02:00:16 +02:00
|
|
|
|
|
|
|
ecm_setup_version(${KF5_VERSION}
|
|
|
|
VARIABLE_PREFIX PLASMA
|
|
|
|
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h"
|
|
|
|
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PlasmaConfigVersion.cmake"
|
|
|
|
SOVERSION 5)
|
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
|
|
|
|
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 #################
|
|
|
|
|
2014-04-26 02:20:13 +02:00
|
|
|
set (REQUIRED_QT_VERSION "5.2.0")
|
2013-01-30 14:53:19 +01:00
|
|
|
|
2014-06-04 18:47:51 +02:00
|
|
|
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Quick Gui Sql Qml Svg Script)
|
2013-10-22 00:40:17 +02:00
|
|
|
|
2014-04-26 13:17:54 +02:00
|
|
|
find_package(KF5Activities ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5DBusAddons ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5Declarative ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5GlobalAccel ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5GuiAddons ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5IconThemes ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5KIO ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5Service ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED)
|
|
|
|
find_package(KF5XmlGui ${KF5_DEP_VERSION} REQUIRED)
|
2014-10-28 15:01:03 +01:00
|
|
|
find_package(KF5Notifications ${KF5_DEP_VERSION} REQUIRED)
|
2014-11-11 16:44:48 +01:00
|
|
|
find_package(KF5Package ${KF5_DEP_VERSION} REQUIRED)
|
2013-10-23 15:45:25 +02:00
|
|
|
|
2014-04-26 13:17:54 +02:00
|
|
|
find_package(KF5DocTools ${KF5_DEP_VERSION})
|
2014-04-04 18:13:48 +02:00
|
|
|
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate documentation"
|
2014-03-26 15:19:50 +01:00
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
|
|
|
|
2013-01-30 14:53:19 +01:00
|
|
|
#optional features
|
2013-02-08 01:03:29 +01:00
|
|
|
find_package(X11 MODULE)
|
2014-02-12 14:00:54 +01:00
|
|
|
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
|
|
|
|
URL "http://www.x.org"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2014-03-27 14:34:16 +01:00
|
|
|
find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE SHAPE XFIXES RENDER)
|
2013-09-04 07:14:24 +02:00
|
|
|
set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
|
|
|
|
URL "http://xcb.freedesktop.org"
|
2014-02-12 14:00:54 +01:00
|
|
|
TYPE OPTIONAL
|
2013-09-04 07:14:24 +02:00
|
|
|
)
|
|
|
|
if(X11_FOUND AND XCB_XCB_FOUND)
|
|
|
|
set(HAVE_X11 1)
|
2014-02-12 14:00:54 +01:00
|
|
|
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS X11Extras)
|
2013-01-30 14:53:19 +01:00
|
|
|
#X11_Xrender discovery is done by FindX11
|
2014-02-17 16:36:56 +01:00
|
|
|
#add_feature_info("X Rendering Extension (libXrender)" X11_Xrender_FOUND "Support for compositing, rendering operations, and alpha-blending. STRONGLY RECOMMENDED")
|
2013-02-08 00:56:43 +01:00
|
|
|
endif()
|
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-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"
|
|
|
|
URL "http://delta.affinix.com/qca"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2013-01-30 14:53:19 +01:00
|
|
|
|
2013-08-18 10:01:44 +02:00
|
|
|
find_package(OpenGL)
|
|
|
|
set_package_properties(OpenGL PROPERTIES DESCRIPTION "The OpenGL libraries"
|
|
|
|
URL "http://www.opengl.org"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
2014-03-06 09:43:52 +01:00
|
|
|
|
|
|
|
find_package(EGL)
|
|
|
|
set_package_properties(EGL PROPERTIES
|
|
|
|
PURPOSE "Support for Window Thumbnail on EGL platform"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
|
|
|
set(HAVE_EGL ${EGL_FOUND})
|
|
|
|
|
2014-02-24 09:41:31 +01:00
|
|
|
if(OPENGL_FOUND AND (${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GL"))
|
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
|
|
|
#########################################################################
|
|
|
|
|
2014-02-08 12:30:02 +01:00
|
|
|
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
|
|
|
|
|
|
|
|
#add_definitions(-Wno-deprecated)
|
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
|
|
|
|
2014-04-28 02:37:14 +02:00
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
|
|
|
|
option(BUILD_EXAMPLES "Build and install Plasma examples." OFF)
|
2014-07-23 20:22:15 +02:00
|
|
|
option(BUILD_COVERAGE "Build Plasma Frameworks with gcov support" OFF)
|
2014-04-28 02:37:14 +02:00
|
|
|
|
2014-07-23 20:22:15 +02:00
|
|
|
if(BUILD_COVERAGE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
|
|
|
|
endif()
|
2014-04-28 02:37:14 +02:00
|
|
|
|
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
|
2014-02-08 12:30:02 +01:00
|
|
|
|
2015-01-10 18:47:31 +01:00
|
|
|
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Plasma")
|
2013-05-03 01:14:19 +02:00
|
|
|
|
2014-02-18 17:14:37 +01:00
|
|
|
ecm_configure_package_config_file(
|
2013-12-11 13:53:09 +01:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/KF5PlasmaConfig.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/KF5PlasmaConfig.cmake"
|
2013-05-03 01:14:19 +02:00
|
|
|
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
2014-04-26 13:14:03 +02:00
|
|
|
PATH_VARS KF5_INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
|
2013-05-03 01:14:19 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES
|
2013-12-11 13:53:09 +01:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/KF5PlasmaConfig.cmake"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/KF5PlasmaConfigVersion.cmake"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/KF5PlasmaMacros.cmake"
|
2013-05-03 01:14:19 +02:00
|
|
|
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
|
|
|
COMPONENT Devel
|
|
|
|
)
|
2013-06-13 01:43:35 +02:00
|
|
|
|
2014-02-08 12:30:02 +01:00
|
|
|
install(EXPORT KF5PlasmaTargets
|
|
|
|
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
|
|
|
FILE KF5PlasmaTargets.cmake
|
|
|
|
NAMESPACE KF5::
|
|
|
|
COMPONENT Devel)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h
|
2015-01-10 18:47:31 +01:00
|
|
|
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel )
|
2014-02-08 12:30:02 +01:00
|
|
|
|
2014-02-11 21:19:47 +01:00
|
|
|
# make plasma_version.h available
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2013-01-30 14:53:19 +01:00
|
|
|
################# list the subdirectories #################
|
2014-04-07 17:55:21 +02:00
|
|
|
if (KF5DocTools_FOUND)
|
2014-04-26 01:37:13 +02:00
|
|
|
add_subdirectory(docs)
|
2014-03-26 15:19:50 +01:00
|
|
|
endif()
|
2014-04-23 12:08:19 +02:00
|
|
|
add_definitions(-DTRANSLATION_DOMAIN=\"libplasma5\")
|
2014-05-06 08:55:04 +02:00
|
|
|
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
|
|
|
|
ki18n_install(po)
|
2014-05-07 18:05:48 +02:00
|
|
|
kdoctools_install(po)
|
2014-05-06 08:55:04 +02:00
|
|
|
endif()
|
2013-05-03 03:16:07 +02:00
|
|
|
add_subdirectory(src)
|
2014-04-28 02:37:14 +02:00
|
|
|
|
|
|
|
if (BUILD_EXAMPLES)
|
|
|
|
add_subdirectory(examples)
|
|
|
|
endif()
|
|
|
|
|
2014-02-10 15:17:07 +01:00
|
|
|
add_subdirectory(autotests)
|
|
|
|
add_subdirectory(tests)
|
2013-01-30 14:53:19 +01:00
|
|
|
|
2014-04-26 02:00:16 +02:00
|
|
|
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
|