-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (45 loc) · 1.79 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
cmake_minimum_required(VERSION 3.16)
project(kodooexample VERSION 0.1)
include(FeatureSummary)
set(QT5_MIN_VERSION 5.15)
set(KF5_MIN_VERSION 5.100)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
#include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMFindQmlModule)
if (NOT ANDROID)
include(KDEGitCommitHooks)
include(KDEClangFormat)
endif()
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX KODOOEXAMPLE
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/version-kodooexample.h"
)
set(QT_EXTRA_COMPONENTS)
if (NOT ANDROID)
list(APPEND QT_EXTRA_COMPONENTS Widgets)
endif()
find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg ${QT_EXTRA_COMPONENTS})
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 CoreAddons Config I18n)
find_package(PkgConfig)
pkg_check_modules(QTXMLRPC REQUIRED Qt5XMLRpc>=1.0.0)
pkg_check_modules(QTODOO REQUIRED Qt5Odoo>=1.0.0)
#ecm_find_qmlmodule(org.kde.kirigamiaddons.labs.mobileform 1.0)
if (ANDROID)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
endif()
add_subdirectory(src)
install(PROGRAMS org.kde.kodooexample.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kodooexample.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
ki18n_install(po)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
if (NOT ANDROID)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()