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

0001 ####
0002  #   Copyright (C) 2005-2009 by Rajko Albrecht  ral@alwins-world.de        #
0003  #                                                                         #
0004  #   This program is free software; you can redistribute it and/or modify  #
0005  #   it under the terms of the GNU General Public License as published by  #
0006  #   the Free Software Foundation; either version 2 of the License, or     #
0007  #   (at your option) any later version.                                   #
0008  #                                                                         #
0009  #   This program is distributed in the hope that it will be useful,       #
0010  #   but WITHOUT ANY WARRANTY; without even the implied warranty of        #
0011  #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
0012  #   GNU General Public License for more details.                          #
0013  #                                                                         #
0014  #   You should have received a copy of the GNU General Public License     #
0015  #   along with this program; if not, write to the                         #
0016  #   Free Software Foundation, Inc.,                                       #
0017  #   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         #
0018  ####
0019 
0020 cmake_minimum_required(VERSION 3.16.0)
0021 
0022 project(kdesvn)
0023 set(PACKAGENAME "${CMAKE_PROJECT_NAME}")
0024 
0025 set(QT_MIN_VERSION "5.15.2")
0026 set(KF_MIN_VERSION "5.98.0")
0027 set(KDE_COMPILERSETTINGS_LEVEL "5.84.0")
0028 
0029 # Where to look for Findxxx.cmake modules
0030 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
0031 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/src/svnqt/cmake)
0032 add_definitions(-DTRANSLATION_DOMAIN="kdesvn")
0033 
0034 include(KDEInstallDirs)
0035 include(KDECMakeSettings)
0036 include(KDECompilerSettings NO_POLICY_SCOPE)
0037 
0038 include(FeatureSummary)
0039 include(ECMInstallIcons)
0040 include(KDEClangFormat)
0041 include(KDEGitCommitHooks)
0042 
0043 find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS
0044     Bookmarks Codecs Completion Config
0045     ConfigWidgets CoreAddons DBusAddons DocTools
0046     I18n IconThemes ItemViews JobWidgets KIO
0047     Notifications Parts Service TextWidgets
0048     Wallet WidgetsAddons XmlGui
0049 )
0050 
0051 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
0052     Core DBus Gui Sql Widgets Xml
0053 )
0054 
0055 # Set the version
0056 set(KDESVN_VERSION_MAJOR 2)
0057 set(KDESVN_VERSION_MINOR 1)
0058 set(KDESVN_VERSION_PATCH 0)
0059 set(KDESVN_VERSION_STRING ${KDESVN_VERSION_MAJOR}.${KDESVN_VERSION_MINOR}.${KDESVN_VERSION_PATCH})
0060 
0061 # Append the git revision if available
0062 # If Git is installed and a '.git' directory is found,
0063 # we append the Git revision to KDESVN_VERSION_STRING
0064 if(EXISTS "${kdesvn_SOURCE_DIR}/.git")
0065   find_package(Git)
0066   if(GIT_FOUND)
0067     message(STATUS "Found git: ${GIT_EXECUTABLE}")
0068     execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
0069                     WORKING_DIRECTORY ${kdesvn_SOURCE_DIR}
0070                     OUTPUT_VARIABLE kdesvn_git_revision
0071                     OUTPUT_STRIP_TRAILING_WHITESPACE)
0072     set(KDESVN_VERSION_STRING "${KDESVN_VERSION_STRING} (rev: ${kdesvn_git_revision})")
0073   endif()
0074 endif()
0075 
0076 option(TESTINGBUILD "Enable/Disable special testing flags" OFF)
0077 if(TESTINGBUILD)
0078     add_definitions(-DTESTING_RC=\"\\\"${CMAKE_SOURCE_DIR}/src/kdesvnui.rc\\\"\" -DTESTING_PARTRC=\"\\\"${CMAKE_SOURCE_DIR}/src/kdesvn_part.rc\\\"\")
0079     add_definitions(-DFORCE_ASKPASS=\"\\\"${CMAKE_BINARY_DIR}/bin/kdesvnaskpass\\\"\")
0080     add_definitions(-DDEBUG_TIMER=1)
0081 endif()
0082 
0083 add_definitions(-DQT_USE_QSTRINGBUILDER)
0084 add_definitions(-DQT_NO_CAST_TO_ASCII)
0085 # not (yet) possible
0086 #add_definitions(-DQT_NO_CAST_FROM_ASCII)
0087 add_definitions(-DQT_RESTRICTED_CAST_FROM_ASCII)
0088 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0089 # kde headers still use Q_FOREACH... :(
0090 # add_definitions(-DQT_NO_FOREACH)
0091 add_definitions(-DQT_DEPRECATED_WARNINGS)
0092 add_definitions(-DQT_STRICT_ITERATORS)
0093 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050900)
0094 add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
0095 
0096 # include(MacroEnsureVersion)
0097 include(FindSubversion)
0098 include(kdesvn-macros)
0099 
0100 # Enable exceptions
0101 kde_enable_exceptions()
0102 
0103 include_directories(
0104     ${CMAKE_BINARY_DIR}
0105 )
0106 include_directories(SYSTEM
0107     ${APR_INCLUDE_DIR}
0108     ${APU_INCLUDE_DIR}
0109     ${SUBVERSION_INCLUDE_DIR}
0110 )
0111 
0112 add_definitions(${APR_CPP_FLAGS})
0113 
0114 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
0115 
0116 add_subdirectory(src)
0117 add_subdirectory(doc)
0118 kdoctools_install(po)
0119 
0120 configure_file(kdesvn-config.h.in kdesvn-config.h @ONLY)
0121 configure_file(Doxyfile.in Doxyfile @ONLY)
0122 configure_file(Doxyfile.svnqt.in Doxyfile.svnqt @ONLY)
0123 
0124 set(DIST_EXCLUDE "Helperstuff/pic_design")
0125 
0126 set(MESSAGES_DIR ${CMAKE_SOURCE_DIR}/src)
0127 
0128 add_custom_target(apidox
0129     "doxygen" "${CMAKE_BINARY_DIR}/Doxyfile"
0130     DEPENDS "${CMAKE_BINARY_DIR}/Doxyfile")
0131 
0132 ki18n_install(po)
0133 
0134 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0135 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0136 
0137 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0138 
0139 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)