Warning, /sdk/gitklient/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 project(gitklient)
0004 set(PROJECT_VERSION 5)
0005 set(PROJECT_VERSION_MAJOR 0)
0006 set(PROJECT_VERSION_MINOR 4)
0007 set(PROJECT_VERSION_PATCH 0)
0008 
0009 set (RELEASE_SERVICE_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
0010 
0011 set(LIBGITKLIENT_LIB_VERSION "${RELEASE_SERVICE_VERSION}")
0012 set(LIBGITKLIENT_LIB_SOVERSION "0")
0013 
0014 
0015 add_definitions(-DGK_VERSION="${RELEASE_SERVICE_VERSION}")
0016 set(REQUIRED_KF5_VERSION "5.90")
0017 set(QT_MIN_VERSION 5.15.2)
0018 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0019 
0020 find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE)
0021 set(
0022     CMAKE_MODULE_PATH
0023     ${ECM_MODULE_PATH}
0024     ${CMAKE_CURRENT_SOURCE_DIR}/cmake
0025 )
0026 
0027 include(KDEInstallDirs)
0028 include(KDECompilerSettings NO_POLICY_SCOPE)
0029 include(KDECMakeSettings NO_POLICY_SCOPE)
0030 include(FeatureSummary)
0031 
0032 include(ECMInstallIcons)
0033 include(ECMQtDeclareLoggingCategory)
0034 include(ECMAddAppIcon)
0035 include(ECMSetupVersion)
0036 include(ECMAddTests)
0037 include(GenerateExportHeader)
0038 include(KDEGitCommitHooks)
0039 include(KDEClangFormat)
0040 include(ECMDeprecationSettings)
0041 
0042 set (CMAKE_CXX_STANDARD 17)
0043 
0044 find_package(
0045     Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION}
0046     CONFIG REQUIRED
0047         Core
0048         Gui
0049         Widgets
0050         Concurrent
0051 )
0052 
0053 find_package(
0054     KF5 ${REQUIRED_KF5_VERSION}
0055     REQUIRED COMPONENTS
0056         ConfigWidgets
0057         CoreAddons
0058         Crash
0059         DBusAddons
0060         DocTools
0061         I18n
0062         XmlGui
0063         KIO
0064         TextWidgets
0065         TextEditor
0066         SyntaxHighlighting
0067 )
0068 
0069 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0070 
0071 add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
0072 add_definitions(-DQT_NO_CAST_TO_ASCII)
0073 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0074 add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
0075 add_definitions(-DQT_NO_FOREACH)
0076 #add_definitions(-DQT_NO_CAST_FROM_ASCII)
0077 
0078 ecm_set_disabled_deprecation_versions(QT 5.15.2
0079     )
0080 
0081 
0082 option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
0083 
0084 set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
0085 if (USE_UNITY_CMAKE_SUPPORT)
0086     set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
0087 endif()
0088 
0089 if(BUILD_TESTING)
0090     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Test)
0091     add_definitions(-DBUILD_TESTING)
0092 endif(BUILD_TESTING)
0093 
0094 
0095 if(KF5DocTools_FOUND)
0096     add_subdirectory(doc)
0097     kdoctools_install(po)
0098 else()
0099     message(WARNING "DocTools not found.")
0100 endif()
0101 
0102 add_subdirectory(icons)
0103 add_subdirectory(src)
0104 #add_subdirectory(autotests)
0105 if (UNIX)
0106     add_subdirectory(dolphinplugins)
0107 endif (UNIX)
0108 
0109 
0110 ecm_qt_install_logging_categories(
0111         EXPORT GITKLIENT
0112         FILE gitklient.categories
0113         DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0114         )
0115 
0116 if (GITKLIENT_BUILD_DIR)
0117     file(WRITE ${GITKLIENT_BUILD_DIR}/version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
0118     message("-- Version in file ${GITKLIENT_BUILD_DIR}/version saved")
0119 endif()
0120 
0121 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0122 ki18n_install(po)
0123 
0124 #CPack
0125 set(CPACK_PACKAGE_NAME ${PROJECT_NAME}
0126     CACHE STRING "The resulting package name"
0127 )
0128 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "KDE git gui client"
0129     CACHE STRING "Package description for the package metadata"
0130 )
0131 set(CPACK_PACKAGE_VENDOR "KDE")
0132 set(CPACK_VERBATIM_VARIABLES YES)
0133 set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
0134 #SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages")
0135 
0136 # https://unix.stackexchange.com/a/11552/254512
0137 #set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/some")#/${CMAKE_PROJECT_VERSION}")
0138 
0139 set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
0140 set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
0141 set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
0142 set(CPACK_PACKAGE_DESCRIPTION   "Git client for KDE")
0143 
0144 set(CPACK_PACKAGE_CONTACT "hamed.masafi@gmail.com")
0145 set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Hamed Masafi")
0146 
0147 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
0148 #set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
0149 
0150 if (GITKLIENT_BUILD_DIR)
0151     set(CPACK_PACKAGE_FILE_NAME "gitklient")
0152 else()
0153     set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
0154 endif()
0155 
0156 set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
0157 # without this you won't be able to pack only specified component
0158 set(CPACK_DEB_COMPONENT_INSTALL YES)
0159 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
0160 
0161 include(CPack)