Warning, /utilities/ktrip/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2019-2021 Nicolas Fella <nicolas.fella@gmx.de>
0002 # SPDX-License-Identifier: BSD-2-Clause
0003 
0004 cmake_minimum_required(VERSION 3.16)
0005 project(ktrip)
0006 
0007 set(PROJECT_VERSION "22.06")
0008 
0009 set(QT_MIN_VERSION "5.15.0")
0010 set(KF5_MIN_VERSION "5.88.0")
0011 
0012 set(CMAKE_CXX_STANDARD 17)
0013 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0014 
0015 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0016 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0017 
0018 include(KDECompilerSettings NO_POLICY_SCOPE)
0019 include(ECMAddTests)
0020 include(ECMGenerateHeaders)
0021 include(ECMQtDeclareLoggingCategory)
0022 include(ECMSetupVersion)
0023 include(FeatureSummary)
0024 include(KDEInstallDirs)
0025 include(KDECMakeSettings)
0026 include(KDEClangFormat)
0027 include(ECMQMLModules)
0028 include(KDEGitCommitHooks)
0029 include(ECMCheckOutboundLicense)
0030 include(ECMAddAppIcon)
0031 
0032 ecm_setup_version(${PROJECT_VERSION}
0033     VARIABLE_PREFIX KTRIP
0034     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/version.h
0035 )
0036 
0037 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2)
0038 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n ItemModels Config)
0039 
0040 if (ANDROID)
0041     # runtime dependencies are build-time dependencies on Android
0042     find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS AndroidExtras Svg)
0043     find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2)
0044     find_package(OpenSSL REQUIRED)
0045 
0046     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
0047 
0048 else()
0049     find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
0050     find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle)
0051 endif()
0052 
0053 find_package(KPublicTransport)
0054 set_package_properties(KPublicTransport PROPERTIES TYPE REQUIRED PURPOSE "Query online journey information")
0055 
0056 ecm_find_qmlmodule(org.kde.kitemmodels 1.0)
0057 ecm_find_qmlmodule(org.kde.kirigamiaddons.dateandtime 0.1)
0058 
0059 add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
0060 add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
0061 add_definitions(-DQT_USE_QSTRINGBUILDER)
0062 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
0063 
0064 ki18n_install(po)
0065 
0066 add_subdirectory(src)
0067 
0068 install(FILES org.kde.ktrip.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0069 
0070 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0071 
0072 # add clang-format target for all our real source files
0073 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0074 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0075 
0076 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0077 
0078 file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h *.qml)
0079 ecm_check_outbound_license(LICENSES GPL-2.0-only GPL-3.0-only FILES ${ALL_SOURCE_FILES})