CMakeLists.txt 3.66 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
3

David Faure's avatar
David Faure committed
4
# KDE Application Version, managed by release script
5
set (RELEASE_SERVICE_VERSION_MAJOR "21")
6
set (RELEASE_SERVICE_VERSION_MINOR "07")
7
set (RELEASE_SERVICE_VERSION_MICRO "80")
David Faure's avatar
David Faure committed
8
9
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")

Albert Astals Cid's avatar
Albert Astals Cid committed
10
project(Konqueror VERSION ${RELEASE_SERVICE_VERSION})
11

12
set(QT_MIN_VERSION "5.12.0")
13
set(KF5_MIN_VERSION "5.71.0")
14

15
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
16
17
18
19
20
21
22

include(FeatureSummary)

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

include(KDEInstallDirs)
include(KDECMakeSettings)
23
include(KDECompilerSettings NO_POLICY_SCOPE)
24
25
include(ECMInstallIcons)
include(ECMSetupVersion)
26
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
27
include(ECMQtDeclareLoggingCategory)
28
include(CMakePackageConfigHelpers)
29
include(GenerateExportHeader)
30

David Faure's avatar
David Faure committed
31
set(KONQUEROR_LIB_VERSION "${RELEASE_SERVICE_VERSION}")
32
set(KONQUEROR_VERSION "${KONQUEROR_LIB_VERSION}")
33

34
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets WebEngineWidgets)
35
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Parts KCMUtils Archive Crash WindowSystem Init IconThemes DBusAddons GuiAddons)
36

37
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Activities DocTools) # Optional
38

39
40
find_package(Hunspell)

41
42
43
44
if(NOT Qt5WebEngineWidgets_VERSION VERSION_LESS "5.13.0")
  add_definitions(-DWEBENGINE_PDF_VIEWER)
endif()

45
46
47
48
if(Qt5WebEngineWidgets_VERSION VERSION_LESS "5.14.0")
  add_definitions(-DWEBENGINEDOWNLOADITEM_USE_PATH)
endif()

49
50
51
52
53
54
find_package(X11)
set(KONQ_HAVE_X11 ${X11_FOUND})

if (X11_FOUND)
  find_package(Qt5 REQUIRED X11Extras)
endif(X11_FOUND)
55

56
57
58
add_definitions(
    -DQT_USE_QSTRINGBUILDER
)
59
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
60

61
62
63
64
65
66
67
include (CheckSymbolExists)
check_symbol_exists(mallinfo        "malloc.h"                 KDE_MALLINFO_MALLOC)
check_symbol_exists(mallinfo        "stdlib.h"                 KDE_MALLINFO_STDLIB)
# TODO KDE_MALLINFO_FIELD_hblkhd
# TODO KDE_MALLINFO_FIELD_uordblks
# TODO KDE_MALLINFO_FIELD_usmblks

68
69
70
71
72
if(Hunspell_FOUND)
set(WEBENGINEPART_DICTIONARY_DIR ${CMAKE_INSTALL_PREFIX}/share/konqueror/webengine_dictionaries CACHE PATH "The directory where dictionary files for WebEnginePart will be put")
add_compile_definitions(WEBENGINEPART_DICTIONARY_DIR="${WEBENGINEPART_DICTIONARY_DIR}")
endif()

73
configure_file (config-konqueror.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-konqueror.h )
74
configure_file (konqueror-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/konqueror-version.h)
75
include_directories(${CMAKE_CURRENT_BINARY_DIR})
76

David Faure's avatar
David Faure committed
77
add_subdirectory( libkonq )
78
add_subdirectory( src )
79
add_subdirectory( client )
80
81
82
if(BUILD_TESTING)
    add_subdirectory( autotests )
endif()
83
add_subdirectory( webenginepart )
84

David Faure's avatar
David Faure committed
85
add_subdirectory( pics )
86
add_subdirectory( sidebar )
Laurent Montel's avatar
Laurent Montel committed
87
add_subdirectory( settings )
David Faure's avatar
David Faure committed
88
add_subdirectory( plugins )
89

90
91
92
93
if (KF5DocTools_FOUND)
    add_subdirectory( doc )
endif()

94
########### install files ###############
95
install( PROGRAMS
96
   kfmclient.desktop kfmclient_html.desktop kfmclient_war.desktop kfmclient_dir.desktop
97
   konqbrowser.desktop
Laurent Montel's avatar
Laurent Montel committed
98
   DESTINATION  ${KDE_INSTALL_APPDIR} )
99
install(FILES org.kde.konqueror.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
100
101
102

# Make sure kfmclient can find konqueror.desktop even if people remove it from the K menu (#62242)
# This is why konqueror.desktop is installed into services.
Laurent Montel's avatar
Laurent Montel committed
103
install( FILES org.kde.konqueror.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
104

105
106
install(FILES konqy_preload.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR})

107
install(FILES konqueror.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
108

Laurent Montel's avatar
Laurent Montel committed
109
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)