Warning, /libraries/kuserfeedback/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.0)
0002 project(KUserFeedback VERSION 1.2.0)
0003 
0004 set(POLICY CMP0048 NEW)
0005 if(POLICY CMP0053)
0006     cmake_policy(SET CMP0053 NEW)
0007 endif()
0008 if(POLICY CMP0063)
0009     cmake_policy(SET CMP0063 NEW)
0010 endif()
0011 if(POLICY CMP0071)
0012     cmake_policy(SET CMP0071 NEW)
0013 endif()
0014 find_package(ECM 5.26 REQUIRED NO_MODULE)
0015 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
0016 
0017 set(ENABLE_SURVEY_TARGET_EXPRESSIONS ON CACHE BOOL "Survey targeting expressions support is enabled by default.")
0018 set(ENABLE_PHP                       ON CACHE BOOL "Syntax checking of PHP server code.")
0019 set(ENABLE_PHP_UNIT                  ON CACHE BOOL "Unit tests for PHP server code.")
0020 set(ENABLE_DOCS                      ON CACHE BOOL "Generate documentation.")
0021 set(ENABLE_CONSOLE                   ON CACHE BOOL "Application console.")
0022 set(ENABLE_CLI                       ON CACHE BOOL "Command line interface support.")
0023 
0024 set(CMAKE_AUTOMOC ON)
0025 set(CMAKE_AUTOUIC ON)
0026 set(CMAKE_AUTORCC ON)
0027 set(CMAKE_INCLUDE_CURRENT_DIR ON)
0028 set(CMAKE_CXX_STANDARD 17)
0029 
0030 include(KDEInstallDirs)
0031 include(KDECMakeSettings)
0032 include(KDECompilerSettings NO_POLICY_SCOPE)
0033 
0034 include(ECMGenerateHeaders)
0035 include(ECMPoQmTools)
0036 include(ECMSetupVersion)
0037 include(ECMQueryQmake)
0038 include(ECMGeneratePriFile)
0039 include(FeatureSummary)
0040 include(GenerateExportHeader)
0041 
0042 ecm_setup_version(PROJECT
0043     VARIABLE_PREFIX KUSERFEEDBACK
0044     VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kuserfeedback_version.h"
0045     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KUserFeedbackConfigVersion.cmake"
0046 )
0047 #
0048 # Dependencies
0049 #
0050 
0051 find_package(Qt${QT_MAJOR_VERSION} 5.4 NO_MODULE REQUIRED COMPONENTS Core Network)
0052 find_package(Qt${QT_MAJOR_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS Widgets Charts Test Qml Svg PrintSupport)
0053 find_package(QmlLint)
0054 if (NOT CMAKE_CROSSCOMPILING)
0055     find_package(Qt${QT_MAJOR_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS Help)
0056 endif()
0057 
0058 if (ENABLE_DOCS)
0059     if(QT_MAJOR_VERSION STREQUAL "5")
0060         find_package(Qt5 CONFIG OPTIONAL_COMPONENTS DocTools)
0061     else()
0062         find_package(Qt6 CONFIG OPTIONAL_COMPONENTS ToolsTools)
0063     endif()
0064 endif()
0065 
0066 set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES URL "http://qt-project.org/")
0067 set_package_properties(Qt${QT_MAJOR_VERSION}Widgets PROPERTIES TYPE RECOMMENDED PURPOSE "Required for feedback configuration and notification widgets.")
0068 set_package_properties(Qt${QT_MAJOR_VERSION}Charts PROPERTIES TYPE RECOMMENDED PURPOSE "Required for UserFeedbackConsole.")
0069 
0070 # debug suffixes for qmake compatibility
0071 if(WIN32)
0072     set(CMAKE_DEBUG_POSTFIX "d")
0073 elseif(APPLE)
0074     set(CMAKE_DEBUG_POSTFIX "_debug")
0075 endif()
0076 
0077 add_definitions(-DQT_USE_QSTRINGBUILDER -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII)
0078 
0079 if (ENABLE_SURVEY_TARGET_EXPRESSIONS)
0080     find_package(FLEX)
0081     set_package_properties(FLEX PROPERTIES TYPE RECOMMENDED PURPOSE "Survey target expression parser.")
0082 
0083     find_package(BISON)
0084     set_package_properties(BISON PROPERTIES TYPE RECOMMENDED PURPOSE "Survey target expression parser.")
0085 
0086     if(FLEX_FOUND AND BISON_FOUND)
0087         set(HAVE_SURVEY_TARGET_EXPRESSIONS 1)
0088     endif()
0089 endif()
0090 add_feature_info("Survey targeting expressions support" HAVE_SURVEY_TARGET_EXPRESSIONS "Requires flex and bison parser generators.")
0091 
0092 if (ENABLE_PHP)
0093     find_package(Php)
0094     set_package_properties(Php PROPERTIES URL "http://php.net" TYPE RECOMMENDED PURPOSE "Syntax checking of PHP server code.")
0095 endif()
0096 
0097 if (ENABLE_PHP_UNIT)
0098     find_package(PhpUnit)
0099     set_package_properties(PhpUnit PROPERTIES URL "http://phpunit.de" TYPE RECOMMENDED PURPOSE "Unit tests for PHP server code.")
0100 endif()
0101 
0102 #
0103 # Actually build the stuff
0104 #
0105 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
0106 configure_file(config-userfeedback.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-userfeedback.h)
0107 
0108 add_subdirectory(src)
0109 
0110 if (BUILD_TESTING)
0111     add_subdirectory(autotests)
0112 
0113     add_subdirectory(tests)
0114 endif()
0115 
0116 if (ENABLE_DOCS)
0117     add_subdirectory(docs)
0118 endif()
0119 
0120 #
0121 # CMake package config file generation
0122 #
0123 include(CMakePackageConfigHelpers)
0124 
0125 if (${QT_MAJOR_VERSION} GREATER_EQUAL 6)
0126     set(_CONFIG_CMAKE_IN "KUserFeedbackConfig-Qt6.cmake.in")
0127 else()
0128     set(_CONFIG_CMAKE_IN "KUserFeedbackConfig-Qt5.cmake.in")
0129 endif()
0130 
0131 configure_package_config_file(
0132     ${CMAKE_CURRENT_SOURCE_DIR}/${_CONFIG_CMAKE_IN}
0133     ${CMAKE_CURRENT_BINARY_DIR}/KUserFeedbackConfig.cmake
0134     INSTALL_DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/KUserFeedback
0135     PATH_VARS KDE_INSTALL_INCLUDEDIR
0136 )
0137 
0138 install(FILES
0139     ${CMAKE_CURRENT_BINARY_DIR}/KUserFeedbackConfig.cmake
0140     ${CMAKE_CURRENT_BINARY_DIR}/KUserFeedbackConfigVersion.cmake
0141     DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/KUserFeedback
0142 )
0143 
0144 install(EXPORT KUserFeedbackTargets DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/KUserFeedback FILE KUserFeedbackTarget.cmake)
0145 
0146 if (ECM_VERSION VERSION_GREATER "5.58.0")
0147     install(FILES org_kde_UserFeedback.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
0148 else()
0149     install(FILES org_kde_UserFeedback.categories DESTINATION ${KDE_INSTALL_CONFDIR})
0150 endif()
0151 
0152 ecm_install_po_files_as_qm(poqm)
0153 
0154 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)