diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | examples/webenginewidgets/spellchecker/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/core/api/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/core/tools/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/core/tools/main.cpp | 15 | ||||
-rw-r--r-- | tests/auto/widgets/spellchecking/CMakeLists.txt | 1 |
6 files changed, 21 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 27ddb15e9..ae8d1013c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,5 +33,4 @@ if(MATRIX_BUILD AND NOT MATRIX_SUBBUILD AND NOT QT_SUPERBUILD) return() endif() -set(WEBENGINE_MODULE_BUILD TRUE) qt_build_repo() diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt index 5cec0087d..16bb677c5 100644 --- a/examples/webenginewidgets/spellchecker/CMakeLists.txt +++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt @@ -74,7 +74,6 @@ foreach(dictFile ${dicts}) PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir} COMMAND ${CMAKE_COMMAND} -E env - $<IF:$<BOOL:${WEBENGINE_MODULE_BUILD}>,QT_WEBENGINE_ICU_DATA_DIR=${CMAKE_CURRENT_BINARY_DIR}/../../../resources,CMAKE=AWESOME> $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict> ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} ${spellcheckerDir}/${dictName}.bdic COMMENT "Running qwebengine_convert_dict" diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt index 4ef5d0c67..f878f3465 100644 --- a/src/core/api/CMakeLists.txt +++ b/src/core/api/CMakeLists.txt @@ -121,6 +121,7 @@ endforeach() if (NOT QT_FEATURE_webengine_system_icu) get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat REALPATH) list(APPEND resourceFiles ${icuFile}) + set_target_properties(WebEngineCore PROPERTIES ICUDTL_FILE ${icuFile}) endif() if(QT_FEATURE_framework) diff --git a/src/core/tools/CMakeLists.txt b/src/core/tools/CMakeLists.txt index e16bfb926..8f764c94b 100644 --- a/src/core/tools/CMakeLists.txt +++ b/src/core/tools/CMakeLists.txt @@ -19,5 +19,15 @@ if(QT_FEATURE_webengine_spellchecker) qt_internal_extend_target(${dict_target_name} CONDITION GCC OR CLANG COMPILE_OPTIONS -Wno-unused-parameter ) + if(NOT QT_FEATURE_webengine_system_icu AND QT_WILL_INSTALL) + # tool can be called durig build so copy icu file + get_target_property(icuFile WebEngineCore ICUDTL_FILE) + addCopyCommand(${dict_target_name} "${icuFile}" + "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}") + endif() + qt_internal_extend_target(${dict_target_name} + CONDITION NOT QT_FEATURE_webengine_system_icu + DEFINES USE_ICU_FILE + ) endif() diff --git a/src/core/tools/main.cpp b/src/core/tools/main.cpp index d79132510..a977fc22d 100644 --- a/src/core/tools/main.cpp +++ b/src/core/tools/main.cpp @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) "en-US.bdic\n\n"; return 1; } - +#if defined(USE_ICU_FILE) bool icuDataDirFound = false; QString icuDataDir = QLibraryInfo::path(QLibraryInfo::DataPath) % QLatin1String("/resources"); @@ -160,6 +160,8 @@ int main(int argc, char *argv[]) // (e.g. for the case when the tool is ran during build phase, and regular installed // ICU data file is not available). const QString icuPossibleEnvDataDir = qEnvironmentVariable("QT_WEBENGINE_ICU_DATA_DIR"); + const QString appPath = QCoreApplication::applicationDirPath(); + QLatin1String icuDataFilePath("/icudtl.dat"); if (!icuPossibleEnvDataDir.isEmpty() && QFileInfo::exists(icuPossibleEnvDataDir)) { icuDataDir = icuPossibleEnvDataDir; icuDataDirFound = true; @@ -173,21 +175,24 @@ int main(int argc, char *argv[]) } #endif // Try to find the ICU data directory in the installed Qt location. - else if (QFileInfo::exists(icuDataDir)) { + else if (QFileInfo::exists(icuDataDir + icuDataFilePath)) { + icuDataDirFound = true; + } else if (QFileInfo::exists(appPath + icuDataFilePath)) { + // during build icudtl file can be simply in application directory + icuDataDir = appPath; icuDataDirFound = true; } - if (icuDataDirFound) { base::PathService::Override(base::DIR_QT_LIBRARY_DATA, toFilePath(icuDataDir)); } else { QTextStream out(stdout); out << "Couldn't find ICU data directory. Please check that the following path exists: " << icuDataDir - << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DAT_DIR " + << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DATA_DIR " "environment variable.\n\n"; return 1; } - +#endif // USE_ICU_FILE base::AtExitManager exit_manager; base::i18n::InitializeICU(); diff --git a/tests/auto/widgets/spellchecking/CMakeLists.txt b/tests/auto/widgets/spellchecking/CMakeLists.txt index 8e1a165c5..a0cd4d052 100644 --- a/tests/auto/widgets/spellchecking/CMakeLists.txt +++ b/tests/auto/widgets/spellchecking/CMakeLists.txt @@ -32,7 +32,6 @@ foreach(dictFile ${dicts}) PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir} COMMAND ${CMAKE_COMMAND} -E env - $<IF:$<BOOL:${WEBENGINE_MODULE_BUILD}>,QT_WEBENGINE_ICU_DATA_DIR=${CMAKE_CURRENT_BINARY_DIR}/../../../../resources,CMAKE=AWESOME> $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict> ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} ${spellcheckerDir}/${dictName}.bdic |