-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
83 lines (64 loc) · 2.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Copyright (c) 2010-2016, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
cmake_minimum_required(VERSION 3.16.0)
# Used to set library's SONAME, change first digit on API/ABI break
set(LIBMEDIAWIKI_LIBVERSION "5.38.0")
project(MediaWiki VERSION ${LIBMEDIAWIKI_LIBVERSION})
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS "Starting CMake configuration for: ${PROJECT_NAME}")
set(KF_MIN_VERSION "5.85.0")
set(QT_MIN_VERSION "5.15.0")
############## ECM setup #################################################################################################################
find_package(ECM ${KF_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMOptionalAddSubdirectory)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
include(FeatureSummary)
# Required Qt5 components to build this framework
find_package(Qt5 ${QT_MIN_VERSION} NO_MODULE REQUIRED Core Network)
find_package(KF5CoreAddons ${KF_MIN_VERSION} REQUIRED)
ecm_setup_version(${LIBMEDIAWIKI_LIBVERSION}
VARIABLE_PREFIX MEDIAWIKI
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mediawiki_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MediaWikiConfigVersion.cmake"
)
# added with KDE_COMPILERSETTINGS_LEVEL 5.85.0
remove_definitions(
-DQT_NO_KEYWORDS
-DQT_NO_FOREACH
)
# Subdirectories
add_subdirectory(src)
add_subdirectory(autotests)
add_subdirectory(tests)
# Create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MediaWiki")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5MediaWikiConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5MediaWikiConfig.cmake"
INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5MediaWikiConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5MediaWikiConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel)
install(EXPORT KF5MediaWikiTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KF5MediaWikiTargets.cmake
NAMESPACE KF5::)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mediawiki_version.h"
DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF5}"
COMPONENT Devel)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)