CMakeLists.txt 2.88 KB
Newer Older
1
2
3
4
5
cmake_minimum_required(VERSION 2.8.12)

project(KXmlGui)

# ECM setup
6
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
7
8
9
10
11

set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(ECMMarkNonGuiExecutable)
include(ECMSetupVersion)
David Faure's avatar
David Faure committed
12
include(ECMGenerateHeaders)
13
include(FeatureSummary)
14
include(GenerateExportHeader)
15
16
17
18
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings)
include(KDECMakeSettings)

Script Kiddy's avatar
Script Kiddy committed
19
set(KF5_VERSION "5.1.0") # handled by release scripts
20
set(KF5_DEP_VERSION "5.0.0") # handled by release scripts
21
22
23
24

ecm_setup_version(${KF5_VERSION}
                  VARIABLE_PREFIX KXMLGUI
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kxmlgui_version.h"
Jonathan Esk-Riddell's avatar
Jonathan Esk-Riddell committed
25
26
                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5XmlGuiConfigVersion.cmake"
                  SOVERSION 5)
27
28

# Dependencies
29
30
set(REQUIRED_QT_VERSION 5.2.0)
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus Xml Network PrintSupport)
31

32
33
34
35
36
37
38
39
40
41
find_package(KF5ItemViews ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5GlobalAccel ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5IconThemes ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5TextWidgets ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5Attica ${KF5_DEP_VERSION})
42

Hrvoje Senjan's avatar
Hrvoje Senjan committed
43
set_package_properties(KF5Attica PROPERTIES DESCRIPTION "A Qt library that implements the Open Collaboration Services API"
44
45
46
47
                       PURPOSE "Support for Get Hot New Stuff in KXMLGUI"
                       URL "https://projects.kde.org/attica"
                       TYPE OPTIONAL
                      )
Hrvoje Senjan's avatar
Hrvoje Senjan committed
48
set (HAVE_ATTICA ${KF5Attica_FOUND})
49
50

# Subdirectories
Aurélien Gâteau's avatar
Aurélien Gâteau committed
51
add_definitions(-DTRANSLATION_DOMAIN=\"kxmlgui5\")
52
53
54
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ki18n_install(po)
endif()
55
56
57
58
59
60
61
62
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(autotests)


# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5XmlGui")

63
include(ECMPackageConfigHelpers)
64

65
ecm_configure_package_config_file(
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5XmlGuiConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5XmlGuiConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5XmlGuiConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5XmlGuiConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

install(EXPORT KF5XmlGuiTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5XmlGuiTargets.cmake NAMESPACE KF5:: )

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kxmlgui_version.h
82
  DESTINATION ${KF5_INCLUDE_INSTALL_DIR} COMPONENT Devel
83
84
)

85
feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)