plasma-framework/CMakeLists.txt

192 lines
7.6 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.8.11)
2013-01-30 14:53:19 +01:00
project(Plasma)
2013-01-30 14:53:19 +01:00
# Make CPack available to easy generate binary packages
include(CPack)
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)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
2013-01-30 14:53:19 +01:00
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
2013-01-30 14:53:19 +01: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")
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)
################# 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)
#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 #################
set (QT_MIN_VERSION "5.2.0")
2013-01-30 14:53:19 +01:00
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Quick X11Extras Sql UiTools Qml Widgets Svg Declarative Script Test)
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
KConfig KAuth KJS KWallet KDBusAddons KI18n KGuiAddons KConfigWidgets
KService ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash KDeclarative
2013-10-22 17:57:55 +02:00
KBookmarks KUnitConversion Kross)
#find_package(KF5Transitional REQUIRED)
# those are not "done" yet:
2013-07-17 10:26:22 +02:00
find_package(KIO REQUIRED NO_MODULE)
2013-06-19 02:53:49 +02:00
# Needed for some includes from KDE/ (KMimeType, etc.)
# FIXME: remove when kdeui is fully split up
find_package(KDELibs4 REQUIRED NO_MODULE)
2013-01-30 14:53:19 +01:00
# must be after KDELibs4, since it links against imported targets coming from KDELibs4Config.cmake:
find_package(KDE4Support REQUIRED NO_MODULE)
2013-01-30 14:53:19 +01:00
2013-10-23 15:45:25 +02:00
#the shell needs kactivities
find_package(KActivities REQUIRED NO_MODULE)
2013-01-30 14:53:19 +01:00
#optional features
find_package(X11 MODULE)
find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE)
set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
URL "http://xcb.freedesktop.org"
TYPE REQUIRED
)
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")
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
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")
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")
endif()
endif()
2013-01-30 14:53:19 +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)"
URL "http://openssl.org"
TYPE RECOMMENDED
PURPOSE "KDE uses OpenSSL for the bulk of secure communications, including secure web browsing via HTTPS"
)
find_package(Libintl MODULE)
2013-02-05 22:17:07 +01:00
set_package_properties(Libintl PROPERTIES DESCRIPTION "Support for multiple languages"
URL "http://www.gnu.org/software/gettext"
TYPE RECOMMENDED
PURPOSE "Enables KDE to be available in many different languages"
)
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
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
#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
# TODO remove it in future
find_package(LibAttica NO_MODULE)
set_package_properties(LibAttica PROPERTIES DESCRIPTION "Support for Get Hot New Stuff related stuff"
URL "https://projects.kde.org/attica"
TYPE REQUIRED
)
find_package(OpenGL)
set_package_properties(OpenGL PROPERTIES DESCRIPTION "The OpenGL libraries"
URL "http://www.opengl.org"
TYPE OPTIONAL
)
if(OPENGL_FOUND)
set(HAVE_GLX ${HAVE_X11})
else()
set(HAVE_GLX 0)
endif()
2013-01-30 14:53:19 +01: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)
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
if(QCA2_FOUND)
include_directories(
${QCA2_INCLUDE_DIR}
)
endif()
2013-01-30 14:53:19 +01:00
include(PlasmaMacros.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
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Plasma")
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
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfigVersion.cmake")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/PlasmaConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
PATH_VARS INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel )
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfigVersion.cmake"
2013-06-13 01:43:35 +02:00
"${CMAKE_CURRENT_SOURCE_DIR}/PlasmaMacros.cmake"
2013-05-03 01:14:19 +02:00
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
2013-06-13 01:43:35 +02:00
2013-01-30 14:53:19 +01:00
################# list the subdirectories #################
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
install(EXPORT PlasmaTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE PlasmaTargets.cmake NAMESPACE KF5:: COMPONENT Devel)
2013-01-30 14:53:19 +01:00
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)