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

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 # KDE Application Version, managed by release script
0004 set(RELEASE_SERVICE_VERSION_MAJOR "22")
0005 set(RELEASE_SERVICE_VERSION_MINOR "11")
0006 set(RELEASE_SERVICE_VERSION_MICRO "70")
0007 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 project(parley VERSION ${RELEASE_SERVICE_VERSION})
0010 set(QT_MIN_VERSION "5.15.2")
0011 set(KF5_MIN_VERSION "5.91.0")
0012 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0013 
0014 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0015 
0016 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0017 
0018 include(KDEInstallDirs)
0019 include(KDECompilerSettings NO_POLICY_SCOPE)
0020 include(KDECMakeSettings)
0021 include(ECMEnableSanitizers)
0022 include(FeatureSummary)
0023 include(KDEClangFormat)
0024 include(KDEGitCommitHooks)
0025 
0026 #Allows QString concatenation to use a single memory allocation per source line.
0027 add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
0028 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0029 add_definitions(-DQT_NO_FOREACH)
0030 add_definitions(-DKNEWSTUFFWIDGETS_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
0031 
0032 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
0033   Core
0034   Svg
0035   Concurrent
0036   Multimedia
0037   WebEngineWidgets
0038 )
0039 
0040 find_package(KF5 ${KF5_MIN_VERSION} MODULE REQUIRED COMPONENTS
0041   DocTools  #to produce the docbook
0042   CoreAddons
0043   Config
0044   Crash
0045   I18n
0046   KIO
0047   NewStuff
0048   Sonnet
0049   TextWidgets
0050   XmlGui
0051   Notifications
0052 )
0053 
0054 find_package(LibKEduVocDocument)
0055 set_package_properties(LibKEduVocDocument PROPERTIES
0056                        TYPE REQUIRED
0057                        PURPOSE "Required to manipulate the KDE word files."
0058                       )
0059 
0060 find_package(LibXslt)
0061 set_package_properties(LibXslt PROPERTIES
0062                        URL "http://xmlsoft.org/XSLT"
0063                        TYPE OPTIONAL
0064                        PURPOSE "Required to build HTML export for Parley."
0065                       )
0066 
0067 find_package(LibXml2)
0068 set_package_properties(LibXml2 PROPERTIES
0069                        URL "http://xmlsoft.org"
0070                        TYPE OPTIONAL
0071                        PURPOSE "Required to build HTML export for Parley."
0072                       )
0073 
0074 find_package(TranslateShell)
0075 set_package_properties(TranslateShell PROPERTIES
0076                        URL "https://github.com/soimort/translate-shell"
0077                        TYPE RUNTIME
0078                        PURPOSE "Runtime dependency for online access to translations"
0079                       )
0080 
0081 # at the end, output the configuration
0082 configure_file(
0083    ${CMAKE_CURRENT_SOURCE_DIR}/config-parley.h.cmake
0084    ${CMAKE_CURRENT_BINARY_DIR}/config-parley.h
0085 )
0086 
0087 # let our config-parley.h be found first in any case
0088 include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR})
0089 
0090 
0091 
0092 # Define link libs for parley executable and unittests
0093 set( parley_LINK_LIBS
0094   LibKEduVocDocumentImport__KEduVocDocument
0095   Qt::Core
0096   Qt::Svg
0097   KF5::I18n
0098   KF5::NewStuffWidgets
0099   KF5::SonnetCore
0100   KF5::SonnetUi
0101   KF5::XmlGui
0102   KF5::Completion
0103   KF5::ConfigWidgets
0104   KF5::ConfigGui
0105   KF5::WidgetsAddons
0106   KF5::TextWidgets
0107   KF5::KIOWidgets
0108   Qt::Widgets
0109   Qt::Gui
0110   Qt::Concurrent
0111   Qt::Multimedia
0112   KF5::Notifications
0113   KF5::Crash
0114   KF5::CoreAddons
0115   Qt::WebEngineWidgets
0116 )
0117 
0118 message(STATUS "cmake cflags ${CMAKE_C_FLAGS}")
0119 message(STATUS "cmake link flags ${CMAKE_EXE_LINKER_FLAGS}")
0120 
0121 if(${LIBXSLT_FOUND} AND ${LIBXML2_FOUND})
0122   set(HAVE_LIBXSLT 1)
0123   message(STATUS "XLST found")
0124   set( parley_LINK_LIBS ${parley_LINK_LIBS} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES})
0125   include_directories(${LIBXML2_INCLUDE_DIR} ${LIBXSLT_INCLUDE_DIR})
0126 else(${LIBXSLT_FOUND} AND ${LIBXML2_FOUND})
0127   set(HAVE_LIBXSLT 0)
0128   message(STATUS "XSLT not found, but not required")
0129 endif(${LIBXSLT_FOUND} AND ${LIBXML2_FOUND})
0130 
0131 if(X11_Xrender_FOUND)
0132   message(STATUS "X11 Xrender found")
0133   set( parley_LINK_LIBS ${parley_LINK_LIBS} ${X11_LIBRARIES} ${X11_Xrender_LIB})
0134 else(X11_Xrender_FOUND)
0135   message(STATUS "X11 Xrender not found, but not required")
0136 endif(X11_Xrender_FOUND)
0137 
0138 if(BUILD_TESTING)
0139   find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Test)
0140   add_subdirectory( autotests )
0141   add_subdirectory( tests )
0142 endif()
0143 
0144 add_subdirectory( docs )
0145 add_subdirectory( src )
0146 add_subdirectory( icons )
0147 add_subdirectory( themes )
0148 
0149 if(HAVE_LIBXSLT)
0150     add_subdirectory( xslt )
0151 endif(HAVE_LIBXSLT)
0152 
0153 ki18n_install(po)
0154 if (KF5DocTools_FOUND)
0155     kdoctools_install(po)
0156 endif()
0157 install(FILES org.kde.parley.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0158 
0159 # add clang-format target for all our real source files
0160 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0161 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0162 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0163 
0164 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)