Warning, /frameworks/khtml/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 cmake_minimum_required(VERSION 3.16) 0002 0003 set(KF_VERSION "5.116.0") # handled by release scripts 0004 set(KF_DEP_VERSION "5.115.0") # handled by release scripts 0005 project(KHtml VERSION ${KF_VERSION}) 0006 0007 include(FeatureSummary) 0008 find_package(ECM 5.115.0 NO_MODULE) 0009 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 0010 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 0011 0012 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) 0013 0014 include(GenerateExportHeader) 0015 include(CMakePackageConfigHelpers) 0016 include(ECMSetupVersion) 0017 include(ECMGenerateHeaders) 0018 include(ECMQtDeclareLoggingCategory) 0019 0020 0021 set(REQUIRED_QT_VERSION 5.15.2) 0022 find_package(Qt5 "${REQUIRED_QT_VERSION}" CONFIG REQUIRED Widgets Network DBus PrintSupport Xml) 0023 include(KDEInstallDirs) 0024 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0025 include(KDECMakeSettings) 0026 0027 # Most of KJS doesn't even require Qt, thus we can't use override 0028 string(REPLACE "-Wsuggest-override" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 0029 0030 find_package(KF5Archive ${KF_DEP_VERSION} REQUIRED) 0031 find_package(KF5Codecs ${KF_DEP_VERSION} REQUIRED) 0032 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED) 0033 find_package(KF5IconThemes ${KF_DEP_VERSION} REQUIRED) 0034 find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED) 0035 find_package(KF5JS ${KF_DEP_VERSION} REQUIRED) 0036 find_package(KF5Notifications ${KF_DEP_VERSION} REQUIRED) 0037 find_package(KF5Parts ${KF_DEP_VERSION} REQUIRED) 0038 find_package(KF5Sonnet ${KF_DEP_VERSION} REQUIRED) 0039 find_package(KF5TextWidgets ${KF_DEP_VERSION} REQUIRED) 0040 find_package(KF5Wallet ${KF_DEP_VERSION} REQUIRED) 0041 find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED) 0042 find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED) 0043 find_package(KF5XmlGui ${KF_DEP_VERSION} REQUIRED) 0044 0045 if(NOT WIN32 AND NOT APPLE) 0046 find_package(KF5GlobalAccel ${KF_DEP_VERSION} REQUIRED) 0047 endif() 0048 0049 set(HAVE_KGLOBALACCEL ${KF5GlobalAccel_FOUND}) 0050 0051 ecm_setup_version(PROJECT VARIABLE_PREFIX KHTML 0052 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/khtml_version.h" 0053 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KHtmlConfigVersion.cmake" 0054 SOVERSION 5) 0055 0056 find_package(Perl) 0057 set_package_properties(Perl PROPERTIES 0058 URL "https://www.perl.org/" 0059 TYPE REQUIRED 0060 PURPOSE "Required for generating JS bindings for elements" 0061 ) 0062 0063 if(NOT WIN32 AND NOT APPLE) 0064 option(WITH_X11 "Build with X11 integration" ON) 0065 if(WITH_X11) 0066 find_package(X11 REQUIRED) 0067 set(HAVE_X11 1) 0068 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras) 0069 endif() 0070 endif() 0071 0072 find_package(Phonon4Qt5 4.6.60) 0073 set_package_properties(Phonon4Qt5 PROPERTIES 0074 DESCRIPTION "Qt Multimedia Library" 0075 URL "https://phonon.kde.org/" 0076 TYPE REQUIRED 0077 PURPOSE "Required for HTML5 multimedia elements" 0078 ) 0079 0080 find_package(JPEG) 0081 set_package_properties(JPEG PROPERTIES DESCRIPTION "JPEG decoding library" 0082 URL "https://www.ijg.org" 0083 TYPE REQUIRED 0084 PURPOSE "Required for decoding and displaying JPEG images" 0085 ) 0086 0087 find_package(GIF) 0088 set_package_properties(GIF PROPERTIES DESCRIPTION "GIF decoding library" 0089 URL "https://sourceforge.net/projects/giflib" 0090 TYPE REQUIRED 0091 PURPOSE "Required for decoding and displaying GIF images" 0092 ) 0093 0094 find_package(PNG) 0095 set_package_properties(PNG PROPERTIES DESCRIPTION "PNG decoding library" 0096 URL "http://www.libpng.org/pub/png" 0097 TYPE REQUIRED 0098 PURPOSE "Required for decoding and displaying PNG images" 0099 ) 0100 0101 find_package(Gperf REQUIRED) 0102 0103 # remove definitions set by KDEFrameworkCompilerSettings which we fail to meet 0104 remove_definitions(-DQT_NO_KEYWORDS) 0105 remove_definitions(-DQT_NO_FOREACH) 0106 remove_definitions(-DQT_NO_CAST_FROM_ASCII) 0107 remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) 0108 # ideally we would support QT_NO_KEYWORDS, but at least we can do this 0109 add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS) 0110 0111 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) 0112 0113 add_definitions(-DENABLE_SVG) 0114 add_definitions(-DENABLE_SVG_FONTS) 0115 add_definitions(-DWTF_PLATFORM_QT) 0116 0117 # avoid warning for "this use of "defined" may not be portable" for all the #if PLATFORM(Foo) 0118 set(_flag "-Wno-expansion-to-defined") 0119 check_cxx_compiler_flag(${_flag} _flag_present) 0120 if(_flag_present) 0121 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}") 0122 endif() 0123 0124 0125 set(KHTML_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) 0126 set(KHTML_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src) 0127 0128 add_definitions(-DTRANSLATION_DOMAIN=\"khtml5\") 0129 ki18n_install(po) 0130 add_subdirectory(src) 0131 if(BUILD_TESTING) 0132 add_subdirectory(tests) 0133 add_subdirectory(autotests) 0134 endif() 0135 0136 # create a Config.cmake and a ConfigVersion.cmake file and install them 0137 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KHtml") 0138 0139 include(CMakePackageConfigHelpers) 0140 0141 configure_package_config_file( 0142 "${CMAKE_CURRENT_SOURCE_DIR}/KF5KHtmlConfig.cmake.in" 0143 "${CMAKE_CURRENT_BINARY_DIR}/KF5KHtmlConfig.cmake" 0144 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0145 ) 0146 0147 install(FILES 0148 "${CMAKE_CURRENT_BINARY_DIR}/KF5KHtmlConfig.cmake" 0149 "${CMAKE_CURRENT_BINARY_DIR}/KF5KHtmlConfigVersion.cmake" 0150 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0151 COMPONENT Devel 0152 ) 0153 0154 install(EXPORT KF5KHtmlTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KHtmlTargets.cmake NAMESPACE KF5:: ) 0155 0156 install(FILES 0157 ${CMAKE_CURRENT_BINARY_DIR}/khtml_version.h 0158 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KHtml COMPONENT Devel 0159 ) 0160 0161 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)