diff options
Diffstat (limited to 'Source/cmake/OptionsQt.cmake')
-rw-r--r-- | Source/cmake/OptionsQt.cmake | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake index 559b2ab8b..003fdca41 100644 --- a/Source/cmake/OptionsQt.cmake +++ b/Source/cmake/OptionsQt.cmake @@ -1,3 +1,4 @@ +include(CheckCXXSourceCompiles) include(FeatureSummary) include(ECMEnableSanitizers) include(ECMPackageConfigHelpers) @@ -53,6 +54,30 @@ macro(CONVERT_PRL_LIBS_TO_CMAKE _qt_component) endif () endmacro() +macro(CHECK_QT5_PRIVATE_INCLUDE_DIRS _qt_component _header) + set(INCLUDE_TEST_SOURCE + " + #include <${_header}> + int main() { return 0; } + " + ) + set(CMAKE_REQUIRED_INCLUDES ${Qt5${_qt_component}_PRIVATE_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES Qt5::${_qt_component}) + + # Avoid check_include_file_cxx() because it performs linking but doesn't support CMAKE_REQUIRED_LIBRARIES (doh!) + check_cxx_source_compiles("${INCLUDE_TEST_SOURCE}" Qt5${_qt_component}_PRIVATE_HEADER_FOUND) + + unset(INCLUDE_TEST_SOURCE) + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) + + if (NOT Qt5${_qt_component}_PRIVATE_HEADER_FOUND) + message(FATAL_ERROR "Header ${_header} is not found. Please make sure that: + 1. Private headers of Qt5${_qt_component} are installed + 2. Qt5${_qt_component}_PRIVATE_INCLUDE_DIRS is correctly defined in Qt5${_qt_component}Config.cmake") + endif () +endmacro() + macro(QT_ADD_EXTRA_WEBKIT_TARGET_EXPORT target) if (QT_STATIC_BUILD OR SHARED_CORE) install(TARGETS ${target} EXPORT WebKitTargets @@ -131,11 +156,13 @@ endif () WEBKIT_OPTION_BEGIN() if (APPLE) + set(MACOS_COMPATIBILITY_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" CACHE STRING "Compatibility version that macOS dylibs should have") + option(MACOS_FORCE_SYSTEM_XML_LIBRARIES "Use system installation of libxml2 and libxslt on macOS" ON) option(MACOS_USE_SYSTEM_ICU "Use system installation of ICU on macOS" ON) option(USE_UNIX_DOMAIN_SOCKETS "Use Unix domain sockets instead of native IPC code on macOS" OFF) option(USE_APPSTORE_COMPLIANT_CODE "Avoid using private macOS APIs which are not allowed on App Store (experimental)" OFF) - set(MACOS_BUILD_FRAMEWORKS ON) # TODO: Make it an option + option(MACOS_BUILD_FRAMEWORKS "Build QtWebKit as framework bundles" ON) if (USE_APPSTORE_COMPLIANT_CODE) set(MACOS_USE_SYSTEM_ICU OFF) @@ -581,6 +608,12 @@ if (ENABLE_QT_WEBCHANNEL) endif () find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS ${QT_REQUIRED_COMPONENTS}) + +CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui private/qhexstring_p.h) +if (ENABLE_WEBKIT2) + CHECK_QT5_PRIVATE_INCLUDE_DIRS(Quick private/qsgrendernode_p.h) +endif () + if (QT_STATIC_BUILD) foreach (qt_module ${QT_REQUIRED_COMPONENTS}) CONVERT_PRL_LIBS_TO_CMAKE(${qt_module}) |