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

0001 cmake_minimum_required(VERSION 3.10)
0002 find_package(ECM 5.54.0 REQUIRED NO_MODULE)
0003 set(CMAKE_CXX_STANDARD 17)
0004 set(CXX_STANDARD_REQUIRED ON)
0005 set(QT_MIN_VERSION "5.12.0")
0006 set(KF_MIN_VERSION "5.84.0")
0007 
0008 project(kirogi VERSION 0.1)
0009 
0010 set(CMAKE_AUTOMOC ON)
0011 set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirogi)
0012 set(CMAKE_AUTORCC ON)
0013 
0014 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
0015 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0016 
0017 include(CMakePackageConfigHelpers)
0018 include(GenerateExportHeader)
0019 include(WriteBasicConfigVersionFile)
0020 include(FeatureSummary)
0021 include(ECMGenerateHeaders)
0022 include(ECMAddAppIcon)
0023 include(ECMInstallIcons)
0024 include(ECMSetupVersion)
0025 include(ECMQMLModules)
0026 include(ECMQtDeclareLoggingCategory)
0027 include(GNUInstallDirs)
0028 include(KDEInstallDirs)
0029 include(KDECompilerSettings NO_POLICY_SCOPE)
0030 include(KDECMakeSettings)
0031 include(KDEClangFormat)
0032 include(FindPkgConfig)
0033 
0034 option(BUILD_APP "Build the Kirogi application." TRUE)
0035 add_feature_info(BUILD_APP BUILD_APP "Build the Kirogi application.")
0036 
0037 option(BUILD_QT_QUICK_LIB "Build the Kirogi library with Qt Quick support." TRUE)
0038 add_feature_info(BUILD_QT_QUICK_LIB BUILD_QT_QUICK_LIB "Build the Kirogi library with Qt Quick support.")
0039 
0040 option(BUILD_PLUGINS "Build the Kirogi plugins." TRUE)
0041 add_feature_info(BUILD_PLUGINS BUILD_PLUGINS "Build the Kirogi plugins.")
0042 
0043 option(CLANG_TIDY "Enable clang-tidy during the build process." FALSE)
0044 add_feature_info(CLANG_TIDY CLANG_TIDY "Enable clang-tidy during the build process.")
0045 
0046 option(COMPILE_QML "Pre-compile QML files using the Qt Quick compiler." FALSE)
0047 add_feature_info(COMPILE_QML COMPILE_QML "Pre-compile QML files using the Qt Quick compiler.")
0048 
0049 option(DEBUG_QML "Build Kirogi with QML debugging/profiling support." FALSE)
0050 add_feature_info(DEBUG_QML DEBUG_QML "Build Kirogi with QML debugging/profiling support.")
0051 
0052 if (CLANG_TIDY)
0053     set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*;-fix")
0054 endif()
0055 
0056 if (BUILD_APP)
0057     if(NOT ANDROID)
0058         set(qtDesktopComponents "Widgets")
0059         set(kfDesktopComponents
0060             "Crash"
0061             "DNSSD"
0062         )
0063     else()
0064         # The Material style requires QtSvg.
0065         set(qtAndroidComponents
0066             "AndroidExtras"
0067             "Svg"
0068         )
0069     endif()
0070 
0071     ecm_find_qmlmodule(QtGamepad 1.12)
0072     ecm_find_qmlmodule(QtGraphicalEffects 1.12)
0073     ecm_find_qmlmodule(QtLocation 5.12)
0074     ecm_find_qmlmodule(org.kde.kirigami 2.6)
0075 
0076     # FIXME TODO: QtGamepad currently causes performance problems on
0077     # Android (blocking multi-tasking) that need to be investigated.
0078     if(NOT ANDROID)
0079         ecm_find_qmlmodule(QtPositioning 5.12)
0080     endif()
0081 endif()
0082 
0083 if(BUILD_APP OR BUILD_QT_QUICK_LIB)
0084     set(qtQuickComponents
0085         "Qml"
0086         "Quick"
0087     )
0088 endif()
0089 
0090 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
0091     Core
0092     Gamepad
0093     Network
0094     Positioning
0095     ${qtQuickComponents}
0096     ${qtDesktopComponents}
0097     ${qtAndroidComponents}
0098 )
0099 
0100 find_package(KF5 ${KF_MIN_VERSION} REQUIRED
0101     ConfigWidgets
0102     CoreAddons
0103     I18n
0104     Kirigami2
0105     ${kfDesktopComponents}
0106 )
0107 
0108 find_package(KF${QT_MAJOR_VERSION}KirigamiAddons 0.11 REQUIRED)
0109 
0110 find_package(PkgConfig REQUIRED)
0111 
0112 pkg_check_modules(GSTREAMER REQUIRED
0113     gstreamer-1.0
0114     gstreamer-video-1.0
0115 )
0116 
0117 link_directories(${GSTREAMER_LIBRARY_DIRS})
0118 include_directories (${GSTREAMER_INCLUDE_DIRS})
0119 
0120 if(ANDROID)
0121     pkg_check_modules(GSTREAMER REQUIRED
0122         gstreamer-1.0
0123         gstreamer-audio-1.0
0124         gstreamer-codecparsers-1.0
0125         gstreamer-controller-1.0
0126         gstreamer-gl-1.0
0127         gstreamer-net-1.0
0128         gstreamer-pbutils-1.0
0129         gstreamer-rtp-1.0
0130         gstreamer-tag-1.0
0131         gstreamer-video-1.0
0132         gio-2.0
0133         graphene-1.0
0134         libjpeg
0135         libpng16
0136         libavformat
0137         libavcodec
0138         libavfilter
0139         libavutil
0140         libswresample
0141         x264
0142     )
0143 
0144     link_directories(${GSTREAMER_LIBRARY_DIRS}/gstreamer-1.0/)
0145 
0146     find_library(liblog log)
0147     find_library(libandroid android)
0148     find_library(libEGL EGL)
0149     find_library(libGLESv2 GLESv2)
0150 endif()
0151 
0152 if(COMPILE_QML)
0153     find_package(Qt5QuickCompiler)
0154 
0155     set_package_properties(Qt5QuickCompiler PROPERTIES
0156         DESCRIPTION "Pre-compile QML files using the Qt Quick compiler."
0157         TYPE OPTIONAL
0158     )
0159 endif()
0160 
0161 if(DEBUG_QML)
0162     message(STATUS "To enable the QML debugger/profiler, run with: '-qmljsdebugger=port:1234'")
0163     add_definitions(-DQMLJSDEBUGGER)
0164     add_definitions(-DQT_DECLARATIVE_DEBUG)
0165     add_definitions(-DQT_QML_DEBUG)
0166 endif()
0167 
0168 add_definitions(
0169   -DQT_USE_QSTRINGBUILDER
0170   -DQT_NO_CAST_TO_ASCII
0171   -DQT_STRICT_ITERATORS
0172   -DQT_NO_URL_CAST_FROM_STRING
0173   -DQT_NO_CAST_FROM_BYTEARRAY
0174   -DQT_NO_SIGNALS_SLOTS_KEYWORDS
0175   -DQT_USE_FAST_OPERATOR_PLUS
0176 )
0177 
0178 # For KConfigXT out-of-source builds.
0179 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0180 
0181 add_subdirectory(data)
0182 add_subdirectory(src)
0183 
0184 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0185 
0186 # Add clang-format target for all our real source files.
0187 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
0188 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})