diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-02-11 15:50:17 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-02-19 08:45:35 +0000 |
commit | c604a1265a7c034dd898a200e8c5f2753a9e7f47 (patch) | |
tree | f3b41194e03a410d95cea2faecd71874495d42d8 | |
parent | b2f03791c1ea263438139b662f62f46fb49a2328 (diff) |
Fix use of uic when cross-compiling
Don't try to build uic but instead import it. This is done centrally now
in add_qt_tool.
Change-Id: I241fbb924de68549e9c0320e157351bd7b1bf5c3
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
-rw-r--r-- | cmake/QtBuild.cmake | 16 | ||||
-rw-r--r-- | src/CMakeLists.txt | 27 |
2 files changed, 20 insertions, 23 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0179086a38..a75c0165c9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -761,6 +761,22 @@ endfunction() # The BOOTSTRAP option allows building it as standalone program, otherwise # it will be linked against QtCore. function(add_qt_tool name) + set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") + if (NOT _build_tools) + message("Searching for ${name}.") + find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) + if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") + message(FATAL_ERROR "The name \"${name}\" was not found in the " + "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") + else() + message(STATUS "${name} was found at ${_PROG_${name}}.") + add_executable("${name}" IMPORTED GLOBAL) + set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") + qt_internal_add_target_aliases("${name}") + endif() + return() + endif() + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) if (arg_BOOTSTRAP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d5962e5c4..0a69798685 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,32 +18,13 @@ function(find_or_build_bootstrap_names) # Move these into their own folder and move this code in the CMakeLists.txt file there! set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - function(find_or_build_bootstrap_tool name) - if (_build_tools) - add_subdirectory(tools/${name}) - else() - message("Searching for ${name}.") - find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) - if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") - message(FATAL_ERROR "The name \"${name}\" was not found in the " - "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") - else() - message("${name} was found at ${_PROG_${name}}.") - add_executable("${name}" IMPORTED GLOBAL) - set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") - - add_executable("Qt::${name}" ALIAS "${name}") - endif() - endif() - endfunction() - if (_build_tools) add_subdirectory(tools/bootstrap) # bootstrap library endif() - find_or_build_bootstrap_tool(moc) - find_or_build_bootstrap_tool(rcc) - find_or_build_bootstrap_tool(qfloat16-tables) - find_or_build_bootstrap_tool(tracegen) + add_subdirectory(tools/moc) + add_subdirectory(tools/rcc) + add_subdirectory(tools/qfloat16-tables) + add_subdirectory(tools/tracegen) if (_build_tools) install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") |