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