From 72066a3a585b4f4fed499c64464ca5ad2ba9f71d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 14 Jun 2019 15:29:21 +0200 Subject: Revert "cmake: Make CMake superbuilds work" Builds fail on Windows, due to splitting on ':' on absolute file paths, when handling syncqt injections. Revert for now to get qt6 merge in faster. This reverts commit 7559d508d1993dd90a4939441eaf353d55462ae5. Change-Id: If139a8a1eb4ae7ccc8d7b835b12e83b03176e28b Reviewed-by: Tobias Hunger Reviewed-by: Qt CMake Build Bot --- cmake/QtBaseGlobalTargets.cmake | 10 +++++----- cmake/QtBuild.cmake | 25 +++++++++---------------- qmake/CMakeLists.txt | 2 +- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index ac039cb4d0..6c5c7e1951 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -4,7 +4,7 @@ add_library(Qt::Platform ALIAS Platform) target_include_directories(Platform INTERFACE $ - $ + $ $ $ ) @@ -65,8 +65,8 @@ qt_install(FILES ## files always lived in Qt::Core, so we keep it that way add_library(GlobalConfig INTERFACE) target_include_directories(GlobalConfig INTERFACE - $ - $ + $ + $ $ $ ) @@ -84,8 +84,8 @@ add_library(Qt::GlobalConfig ALIAS GlobalConfig) add_library(GlobalConfigPrivate INTERFACE) target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig) target_include_directories(GlobalConfigPrivate INTERFACE - $ - $ + $ + $ $ $ ) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f69c5f5f21..9f358d164d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -272,10 +272,6 @@ endfunction() # cmake_install.cmake file with an empty one. This means we will always replace the file on # every reconfiguration, but not when doing null builds. function(remove_install_target) - if (TARGET remove_cmake_install) - return() # target was already created - endif() - set(file_in "${CMAKE_BINARY_DIR}/.remove_cmake_install_in.txt") set(file_generated "${CMAKE_BINARY_DIR}/.remove_cmake_install_generated.txt") set(cmake_install_file "${CMAKE_BINARY_DIR}/cmake_install.cmake") @@ -947,24 +943,20 @@ function(qt_install_injections module build_dir install_dir) # # ${some_prefix}'s value depends on the build type. # If doing a prefix build, it should point to - # the current repo's build dir which is ${qtdeclarative_build_dir}. + # ${current_repo_build_dir} which is ${qtdeclarative_build_dir}. # If doing a non-prefix build, it should point to - # qtbase's build dir. + # ${qtbase_build_dir}. # # In the code below, ${some_prefix} == ${build_dir}. set(lower_case_forwarding_header_path "${build_dir}/${INSTALL_INCLUDEDIR}/${module}") if(destinationdir) string(APPEND lower_case_forwarding_header_path "/${destinationdir}") endif() - if (IS_ABSOLUTE "${file}") - set(file_path "${file}") - else() - set(file_path "${PROJECT_BINARY_DIR}/${file}") - endif() + set(current_repo_build_dir "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH relpath "${lower_case_forwarding_header_path}" - "${file_path}") + "${current_repo_build_dir}/${file}") set(main_contents "#include \"${relpath}\"") file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" CONTENT "${main_contents}") @@ -974,7 +966,7 @@ function(qt_install_injections module build_dir install_dir) # will be a no-op. qt_path_join(install_destination ${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) - qt_install(FILES ${file_path} + qt_install(FILES ${current_repo_build_dir}/${file} DESTINATION ${install_destination} RENAME ${destinationname} OPTIONAL) @@ -1145,7 +1137,7 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) set(_public_includes - $ + $ $ ) if(NOT arg_NO_MODULE_HEADERS) @@ -1497,7 +1489,7 @@ function(add_qt_plugin target) "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" # For the syncqt headers - $ + $ ${arg_INCLUDE_DIRECTORIES} PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} LIBRARIES ${arg_LIBRARIES} Qt::PlatformPluginInternal @@ -2063,6 +2055,7 @@ function(qt_compute_injection_forwarding_header target) get_filename_component(file_name "${arg_SOURCE}" NAME) set(source_absolute_path "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") + file(RELATIVE_PATH relpath "${CMAKE_BINARY_DIR}" "${source_absolute_path}") if (arg_PRIVATE) set(fwd "${PROJECT_VERSION}/${module}/private/${file_name}") @@ -2070,7 +2063,7 @@ function(qt_compute_injection_forwarding_header target) set(fwd "${file_name}") endif() - string(APPEND ${arg_OUT_VAR} " ${source_absolute_path}:${fwd}") + string(APPEND ${arg_OUT_VAR} " ${relpath}:${fwd}") set(${arg_OUT_VAR} ${${arg_OUT_VAR}} PARENT_SCOPE) endfunction() diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 22fbda307b..6f8763524f 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -124,7 +124,7 @@ add_qt_tool(qmake # special case generators/win32 library $ # special case - ${CMAKE_CURRENT_BINARY_DIR}/../src/corelib/global # special case: for qconfig.cpp + ${CMAKE_BINARY_DIR}/src/corelib/global # special case: for qconfig.cpp ) qt_internal_add_target_aliases(Bootstrap) # special case -- cgit v1.2.3