Warning, /education/cantor/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required (VERSION 3.13 FATAL_ERROR)
0002 
0003 set(CMAKE_CXX_STANDARD 11)
0004 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0005 
0006 set (RELEASE_SERVICE_VERSION_MAJOR "22")
0007 set (RELEASE_SERVICE_VERSION_MINOR "08")
0008 set (RELEASE_SERVICE_VERSION_MICRO "1")
0009 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0010 
0011 project(cantor VERSION ${RELEASE_SERVICE_VERSION})
0012 
0013 set(KF5_MIN_VERSION "5.70.0")
0014 
0015 find_package(ECM 5.15.0 REQUIRED CONFIG)
0016 set(CMAKE_MODULE_PATH ${cantor_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
0017 
0018 include(KDEInstallDirs)
0019 include(KDECMakeSettings)
0020 include(KDECompilerSettings NO_POLICY_SCOPE)
0021 
0022 include(ECMInstallIcons)
0023 include(ECMSetupVersion)
0024 include(ECMAddAppIcon)
0025 include(KDEClangFormat)
0026 include(GenerateExportHeader)
0027 include(FeatureSummary)
0028 
0029 set( SharedMimeInfo_MINIMUM_VERSION "1.3" ) #TODO: What is the minimum required version?
0030 find_package(SharedMimeInfo ${SharedMimeInfo_MINIMUM_VERSION} REQUIRED)
0031 
0032 find_package(Qt5 5.8.0 CONFIG REQUIRED
0033     Core
0034     Widgets
0035     PrintSupport
0036     Svg
0037     Xml
0038     XmlPatterns
0039     Test
0040     Help
0041     WebEngine
0042     WebEngineWidgets)
0043 
0044 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
0045     Config
0046     Crash
0047     Completion
0048     DocTools
0049     NewStuff
0050     IconThemes
0051     TextEditor
0052     CoreAddons
0053     Archive
0054     Parts
0055     SyntaxHighlighting
0056     TextWidgets
0057     KIO
0058     XmlGui
0059     I18n
0060 )
0061 
0062 find_package(Poppler "0.62.0" REQUIRED COMPONENTS Qt5)
0063 
0064 
0065 if(NOT WIN32)
0066 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED Pty)
0067 endif()
0068 
0069 option(USE_LIBSPECTRE "Use libspectre library" ON)
0070 
0071 add_subdirectory(thirdparty)
0072 # Need to set this here, because variable can't move from subdirectory (thirdparty) to upper cmake scope
0073 set(Discount_FOUND TRUE)
0074 
0075 if(NOT WIN32 AND USE_LIBSPECTRE)
0076     set_package_properties(LibSpectre PROPERTIES DESCRIPTION "A PostScript rendering library"
0077         URL "https://www.freedesktop.org/wiki/Software/libspectre/"
0078         TYPE OPTIONAL
0079         PURPOSE "Support for rendering EPS files in Cantor")
0080 
0081     find_package(LibSpectre)
0082     if(LIBSPECTRE_FOUND)
0083         set(WITH_EPS On)
0084     else(LIBSPECTRE_FOUND)
0085         set(WITH_EPS Off)
0086     endif(LIBSPECTRE_FOUND)
0087 
0088 else()
0089     set(WITH_EPS Off)
0090 endif()
0091 
0092 #[[
0093 find_package(Discount 2.2.0)
0094 set_package_properties(Discount PROPERTIES DESCRIPTION "A C implementation of the Markdown markup language"
0095     URL "https://www.pell.portland.or.us/~orc/Code/discount/"
0096     TYPE OPTIONAL
0097     PURPOSE "Used for Markdown entries in Cantor")
0098 ]]#
0099 
0100 add_definitions(
0101     -DQT_NO_CAST_TO_ASCII
0102     -DQT_NO_CAST_FROM_ASCII
0103     -DQT_NO_URL_CAST_FROM_STRING
0104     -DQT_NO_CAST_FROM_BYTEARRAY
0105     -DQT_USE_QSTRINGBUILDER
0106     -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
0107     -DQT_NO_SIGNALS_SLOTS_KEYWORDS
0108     -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
0109     -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
0110 )
0111 if (NOT WIN32)
0112     # Strict iterators can't be used on Windows, they lead to a link error
0113     # when application code iterates over a QVector<QPoint> for instance, unless
0114     # Qt itself was also built with strict iterators.
0115     # See example at https://bugreports.qt.io/browse/AUTOSUITE-946
0116     add_definitions(-DQT_STRICT_ITERATORS)
0117 endif()
0118 
0119 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
0120    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
0121 
0122    # both gcc & clang support it since the same version
0123    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0.0)
0124       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" )
0125    endif()
0126 endif()
0127 
0128 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG_OUTPUT")
0129 
0130 kde_enable_exceptions()
0131 
0132 # FIXME Looks like docbook on Windows don't buildable at all, so it are temporarily disabled
0133 if(NOT WIN32)
0134     add_subdirectory(doc)
0135 endif(NOT WIN32)
0136 add_subdirectory(src)
0137 add_subdirectory(icons)
0138 
0139 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Cantor")
0140 configure_package_config_file(
0141     ${CMAKE_CURRENT_SOURCE_DIR}/CantorConfig.cmake.in
0142     ${CMAKE_CURRENT_BINARY_DIR}/CantorConfig.cmake
0143     INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}/
0144     #PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR
0145 )
0146 
0147 ecm_setup_version(${RELEASE_SERVICE_VERSION}
0148     VARIABLE_PREFIX CANTOR
0149     VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/cantor_version.h"
0150     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/CantorConfigVersion.cmake"
0151 )
0152 install(
0153     FILES ${CMAKE_CURRENT_BINARY_DIR}/CantorConfig.cmake
0154           ${CMAKE_CURRENT_BINARY_DIR}/CantorConfigVersion.cmake
0155     DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0156     COMPONENT Devel
0157 )
0158 
0159 install(EXPORT CantorTargets
0160     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0161     FILE CantorTargets.cmake
0162     NAMESPACE Cantor::
0163 )
0164 
0165 
0166 ki18n_install(po)
0167 if (KF5DocTools_FOUND)
0168     kdoctools_install(po)
0169 endif()
0170 install(FILES org.kde.cantor.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0171 
0172 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
0173 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0174 
0175 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)