Use correct module include name across the project

Module may have specific module include name that should be taken into
account when specifying module include directories in different places.
The INTERFACE_MODULE_INCLUDE_NAME module property name is aligned to
the common naming rules and the property is used to preform include
paths instead of the direct use of the module name.

Add additional paths generated by qt_internal_module_info to keep them
consistent across all cmake files.

Change-Id: I4c94017abc322c48616f47e65e371bd863bb087d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 928ffbd1e20860fdcfbddde8e39303252a9ebb98)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2021-07-30 13:16:10 +02:00
parent e1d539b73a
commit 9c8dca0fb5
4 changed files with 161 additions and 52 deletions

View File

@ -120,6 +120,14 @@ function(qt_internal_add_module target)
message(FATAL_ERROR "Invalid target type '${target_type}' for Qt module '${target}'") message(FATAL_ERROR "Invalid target type '${target_type}' for Qt module '${target}'")
endif() endif()
if(NOT arg_NO_SYNC_QT AND NOT arg_NO_MODULE_HEADERS AND arg_MODULE_INCLUDE_NAME)
# qt_internal_module_info uses this property if it's set, so it must be
# specified before the qt_internal_module_info call.
set_target_properties(${target} PROPERTIES
_qt_module_include_name ${arg_MODULE_INCLUDE_NAME}
)
endif()
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES
_qt_module_interface_name "${arg_MODULE_INTERFACE_NAME}" _qt_module_interface_name "${arg_MODULE_INTERFACE_NAME}"
) )
@ -264,19 +272,15 @@ function(qt_internal_add_module target)
endif() endif()
endif() endif()
if(arg_MODULE_INCLUDE_NAME)
set(module_include_name ${arg_MODULE_INCLUDE_NAME})
else()
set(module_include_name ${module})
endif()
# Module headers: # Module headers:
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES _qt_module_has_headers) set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES _qt_module_has_headers)
if(${arg_NO_MODULE_HEADERS} OR ${arg_NO_SYNC_QT}) if(${arg_NO_MODULE_HEADERS} OR ${arg_NO_SYNC_QT})
set_target_properties("${target}" PROPERTIES set_target_properties("${target}" PROPERTIES
_qt_module_has_headers OFF) _qt_module_has_headers OFF)
else() else()
set_target_properties("${target}" PROPERTIES INTERFACE_MODULE_INCLUDE_NAME "${module_include_name}") set_property(TARGET ${target} APPEND PROPERTY EXPORT_PROPERTIES _qt_module_include_name)
set_target_properties("${target}" PROPERTIES
_qt_module_include_name "${module_include_name}")
# Use QT_BUILD_DIR for the syncqt call. # Use QT_BUILD_DIR for the syncqt call.
# So we either write the generated files into the qtbase non-prefix build root, or the # So we either write the generated files into the qtbase non-prefix build root, or the
@ -300,9 +304,9 @@ function(qt_internal_add_module target)
_qt_module_has_headers ON) _qt_module_has_headers ON)
### FIXME: Can we replace headers.pri? ### FIXME: Can we replace headers.pri?
set(module_include_dir "${QT_BUILD_DIR}/include/${module_include_name}") qt_read_headers_pri("${module_build_interface_include_dir}" "module_headers")
qt_read_headers_pri("${module_include_dir}" "module_headers") set(module_depends_header
set(module_depends_header "${module_include_dir}/${module_include_name}Depends") "${module_build_interface_include_dir}/${module_include_name}Depends")
if(is_framework) if(is_framework)
if(NOT is_interface_lib) if(NOT is_interface_lib)
set(public_headers_to_copy "${module_headers_public}" "${module_depends_header}") set(public_headers_to_copy "${module_headers_public}" "${module_depends_header}")
@ -315,7 +319,8 @@ function(qt_internal_add_module target)
set_property(TARGET ${target} APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") set_property(TARGET ${target} APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}")
endif() endif()
if (NOT ${arg_HEADER_MODULE}) if (NOT ${arg_HEADER_MODULE})
set_property(TARGET "${target}" PROPERTY MODULE_HEADER "${module_include_dir}/${module_include_name}") set_property(TARGET "${target}" PROPERTY MODULE_HEADER
"${module_build_interface_include_dir}/${module_include_name}")
endif() endif()
if(module_headers_qpa) if(module_headers_qpa)
@ -324,7 +329,7 @@ function(qt_internal_add_module target)
else() else()
qt_install( qt_install(
FILES ${module_headers_qpa} FILES ${module_headers_qpa}
DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module_include_name}/qpa) DESTINATION "${module_install_interface_versioned_inner_include_dir}/qpa")
endif() endif()
endif() endif()
endif() endif()
@ -376,20 +381,20 @@ function(qt_internal_add_module target)
# Make sure to create such paths for both the the BUILD_INTERFACE and the INSTALL_INTERFACE. # Make sure to create such paths for both the the BUILD_INTERFACE and the INSTALL_INTERFACE.
# #
# Only add syncqt headers if they exist. # Only add syncqt headers if they exist.
# This handles cases like QmlDevTools which do not have their own headers, but borrow them # This handles cases like QmlDevToolsPrivate which do not have their own headers, but borrow them
# from another module. # from another module.
if(NOT arg_NO_SYNC_QT AND NOT arg_NO_MODULE_HEADERS) if(NOT arg_NO_SYNC_QT AND NOT arg_NO_MODULE_HEADERS)
# Don't include private headers unless they exist, aka syncqt created them. # Don't include private headers unless they exist, aka syncqt created them.
if(module_headers_private) if(module_headers_private)
list(APPEND private_includes list(APPEND private_includes
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" "$<BUILD_INTERFACE:${module_build_interface_versioned_include_dir}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>") "$<BUILD_INTERFACE:${module_build_interface_versioned_inner_include_dir}>")
endif() endif()
list(APPEND public_includes list(APPEND public_includes
# For the syncqt headers # For the syncqt headers
"$<BUILD_INTERFACE:${module_repo_include_dir}>" "$<BUILD_INTERFACE:${repo_build_interface_include_dir}>"
"$<BUILD_INTERFACE:${module_include_dir}>") "$<BUILD_INTERFACE:${module_build_interface_include_dir}>")
endif() endif()
if(is_framework) if(is_framework)
@ -412,7 +417,8 @@ function(qt_internal_add_module target)
if(NOT arg_NO_MODULE_HEADERS AND NOT arg_NO_SYNC_QT) if(NOT arg_NO_MODULE_HEADERS AND NOT arg_NO_SYNC_QT)
# For the syncqt headers # For the syncqt headers
list(APPEND ${public_headers_list} "$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/${module}>") list(APPEND ${public_headers_list}
"$<INSTALL_INTERFACE:${module_install_interface_include_dir}>")
# To support finding Qt module includes that are not installed into the main Qt prefix. # To support finding Qt module includes that are not installed into the main Qt prefix.
# Use case: A Qt module built by Conan installed into a prefix other than the main prefix. # Use case: A Qt module built by Conan installed into a prefix other than the main prefix.
@ -642,8 +648,8 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")")
LIBRARY DESTINATION ${INSTALL_LIBDIR} LIBRARY DESTINATION ${INSTALL_LIBDIR}
ARCHIVE DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${INSTALL_LIBDIR} FRAMEWORK DESTINATION ${INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module_include_name} PUBLIC_HEADER DESTINATION "${module_install_interface_include_dir}"
PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module_include_name}/${PROJECT_VERSION}/${module}/private PRIVATE_HEADER DESTINATION "${module_install_interface_private_include_dir}"
) )
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
@ -681,7 +687,7 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")")
set(interface_includes "") set(interface_includes "")
# Handle cases like QmlDevTools which do not have their own headers, but rather borrow them # Handle cases like QmlDevToolsPrivate which do not have their own headers, but rather borrow them
# from another module. # from another module.
if(NOT arg_NO_SYNC_QT) if(NOT arg_NO_SYNC_QT)
list(APPEND interface_includes "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>") list(APPEND interface_includes "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
@ -692,10 +698,10 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")")
# consumers of the module will fail at CMake generation time stating that # consumers of the module will fail at CMake generation time stating that
# INTERFACE_INCLUDE_DIRECTORIES contains a non-existent path. # INTERFACE_INCLUDE_DIRECTORIES contains a non-existent path.
if(NOT arg_NO_MODULE_HEADERS if(NOT arg_NO_MODULE_HEADERS
AND EXISTS "${module_include_dir}/${PROJECT_VERSION}/${module}") AND EXISTS "${module_build_interface_versioned_inner_include_dir}")
list(APPEND interface_includes list(APPEND interface_includes
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" "$<BUILD_INTERFACE:${module_build_interface_versioned_include_dir}>"
"$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>") "$<BUILD_INTERFACE:${module_build_interface_versioned_inner_include_dir}>")
if(is_framework) if(is_framework)
set(fw_install_private_header_dir "${INSTALL_LIBDIR}/${fw_private_header_dir}") set(fw_install_private_header_dir "${INSTALL_LIBDIR}/${fw_private_header_dir}")
@ -705,8 +711,8 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")")
"$<INSTALL_INTERFACE:${fw_install_private_module_header_dir}>") "$<INSTALL_INTERFACE:${fw_install_private_module_header_dir}>")
else() else()
list(APPEND interface_includes list(APPEND interface_includes
"$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}>" "$<INSTALL_INTERFACE:${module_install_interface_versioned_include_dir}>"
"$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}>") "$<INSTALL_INTERFACE:${module_install_interface_versioned_inner_include_dir}>")
endif() endif()
endif() endif()
endif() endif()
@ -756,36 +762,136 @@ function(qt_finalize_module target)
endfunction() endfunction()
# Get a set of Qt module related values based on the target. # Get a set of Qt module related values based on the target.
# When doing qt_internal_module_info(foo Core) this method will set #
# the following variables in the caller's scope: # The function uses the _qt_module_interface_name and _qt_module_include_name target properties to
# preform values for the output variables. _qt_module_interface_name it's the basic name of module
# without "Qtfication" and the "Private" suffix if we speak about INTERNAL_MODULEs. Typical value of
# the _qt_module_interface_name is the provided to qt_internal_add_module ${target} name, e.g. Core.
# _qt_module_interface_name is used to preform all the include paths unless the
# _qt_module_include_name property is specified. _qt_module_include_name is legacy property that
# replaces the module name in include paths and has a higher priority than the
# _qt_module_interface_name property.
#
# When doing qt_internal_module_info(foo Core) this method will set the following variables in
# the caller's scope:
# * foo with the value "QtCore" # * foo with the value "QtCore"
# * foo_versioned with the value "Qt6Core" (based on major Qt version) # * foo_versioned with the value "Qt6Core" (based on major Qt version)
# * foo_upper with the value "CORE" # * foo_upper with the value "CORE"
# * foo_lower with the value "core" # * foo_lower with the value "core"
# * foo_repo_include_dir with the module's include directory # * foo_include_name with the value"QtCore"
# e.g for QtQuick it would be qtdeclarative_build_dir/include for a prefix build or # Usually the module name from ${foo} is used, but the name might be different if the
# qtbase_build_dir/include for a non-prefix build # MODULE_INCLUDE_NAME argument is set when creating the module.
# * foo_include_dir with the module's include directory # * foo_versioned_include_dir with the value "QtCore/6.2.0"
# e.g for QtQuick it would be qtdeclarative_build_dir/include/QtQuick for a prefix build or # * foo_versioned_inner_include_dir with the value "QtCore/6.2.0/QtCore"
# qtbase_build_dir/include/QtQuick for a non-prefix build # * foo_private_include_dir with the value "QtCore/6.2.0/QtCore/private"
# * foo_interface_name the interface name of the module stored in _qt_module_interface_name # * foo_interface_name the interface name of the module stored in _qt_module_interface_name
# property. # property, e.g. Core.
#
# The function also sets a bunch of module include paths for the build and install interface.
# Variables that contains these paths start with foo_build_interface_ and foo_install_interface_
# accordingly.
# The following variables are set in the caller's scope:
# * foo_<build|install>_interface_include_dir with
# qtbase_build_dir/include/QtCore for build interface and
# include/QtCore for install interface.
# * foo_<build|install>_interface_versioned_include_dir with
# qtbase_build_dir/include/QtCore/6.2.0 for build interface and
# include/QtCore/6.2.0 for install interface.
# * foo_<build|install>_versioned_inner_include_dir with
# qtbase_build_dir/include/QtCore/6.2.0/QtCore for build interface and
# include/QtCore/6.2.0/QtCore for install interface.
# * foo_<build|install>_private_include_dir with
# qtbase_build_dir/include/QtCore/6.2.0/QtCore/private for build interface and
# include/QtCore/6.2.0/QtCore/private for install interface.
# The following values are set by the function and might be useful in caller's scope:
# * repo_install_interface_include_dir contains path to the top-level repository include directory,
# e.g. qtbase_build_dir/include
# * repo_install_interface_include_dir contains path to the non-prefixed top-level include
# directory is used for the installation, e.g. include
# Note: that for non-prefixed Qt configurations the build interface paths will start with
# <build_directory>/qtbase/include, e.g foo_build_interface_include_dir of the Qml module looks
# like qt_toplevel_build_dir/qtbase/include/QtQml
function(qt_internal_module_info result target) function(qt_internal_module_info result target)
if(result STREQUAL "repo")
message(FATAL_ERROR "'repo' keyword is reserved for internal use, please specify \
the different base name for the module info variables.")
endif()
get_target_property(module_interface_name ${target} _qt_module_interface_name) get_target_property(module_interface_name ${target} _qt_module_interface_name)
if(NOT module_interface_name) if(NOT module_interface_name)
message(FATAL_ERROR "${target} is not a module.") message(FATAL_ERROR "${target} is not a module.")
endif() endif()
qt_internal_qtfy_target(module ${module_interface_name}) qt_internal_qtfy_target(module ${module_interface_name})
get_target_property("${result}_include_name" ${target} _qt_module_include_name)
if(NOT ${result}_include_name)
set("${result}_include_name" "${module}")
endif()
set("${result}_versioned_include_dir"
"${${result}_include_name}/${PROJECT_VERSION}")
set("${result}_versioned_inner_include_dir"
"${${result}_versioned_include_dir}/${${result}_include_name}")
set("${result}_private_include_dir"
"${${result}_versioned_inner_include_dir}/private")
# Module build interface directories
set(repo_build_interface_include_dir "${QT_BUILD_DIR}/include")
set("${result}_build_interface_include_dir"
"${repo_build_interface_include_dir}/${${result}_include_name}")
set("${result}_build_interface_versioned_include_dir"
"${repo_build_interface_include_dir}/${${result}_versioned_include_dir}")
set("${result}_build_interface_versioned_inner_include_dir"
"${repo_build_interface_include_dir}/${${result}_versioned_inner_include_dir}")
set("${result}_build_interface_private_include_dir"
"${repo_build_interface_include_dir}/${${result}_private_include_dir}")
# Module install interface direcotries
set(repo_install_interface_include_dir "${INSTALL_INCLUDEDIR}")
set("${result}_install_interface_include_dir"
"${repo_install_interface_include_dir}/${${result}_include_name}")
set("${result}_install_interface_versioned_include_dir"
"${repo_install_interface_include_dir}/${${result}_versioned_include_dir}")
set("${result}_install_interface_versioned_inner_include_dir"
"${repo_install_interface_include_dir}/${${result}_versioned_inner_include_dir}")
set("${result}_install_interface_private_include_dir"
"${repo_install_interface_include_dir}/${${result}_private_include_dir}")
set("${result}" "${module}" PARENT_SCOPE) set("${result}" "${module}" PARENT_SCOPE)
set("${result}_versioned" "${module_versioned}" PARENT_SCOPE) set("${result}_versioned" "${module_versioned}" PARENT_SCOPE)
string(TOUPPER "${module_interface_name}" upper) string(TOUPPER "${module_interface_name}" upper)
string(TOLOWER "${module_interface_name}" lower)# * foo_upper with the value "CORE" string(TOLOWER "${module_interface_name}" lower)
set("${result}_upper" "${upper}" PARENT_SCOPE) set("${result}_upper" "${upper}" PARENT_SCOPE)
set("${result}_lower" "${lower}" PARENT_SCOPE) set("${result}_lower" "${lower}" PARENT_SCOPE)
set("${result}_repo_include_dir" "${QT_BUILD_DIR}/include" PARENT_SCOPE) set("${result}_include_name" "${${result}_include_name}" PARENT_SCOPE)
set("${result}_include_dir" "${QT_BUILD_DIR}/include/${module}" PARENT_SCOPE) set("${result}_versioned_include_dir" "${${result}_versioned_include_dir}" PARENT_SCOPE)
set("${result}_versioned_inner_include_dir"
"${${result}_versioned_inner_include_dir}" PARENT_SCOPE)
set("${result}_private_include_dir" "${${result}_private_include_dir}" PARENT_SCOPE)
set("${result}_interface_name" "${module_interface_name}" PARENT_SCOPE) set("${result}_interface_name" "${module_interface_name}" PARENT_SCOPE)
# Setting module build interface directories in parent scope
set(repo_build_interface_include_dir "${repo_build_interface_include_dir}" PARENT_SCOPE)
set("${result}_build_interface_include_dir"
"${${result}_build_interface_include_dir}" PARENT_SCOPE)
set("${result}_build_interface_versioned_include_dir"
"${${result}_build_interface_versioned_include_dir}" PARENT_SCOPE)
set("${result}_build_interface_versioned_inner_include_dir"
"${${result}_build_interface_versioned_inner_include_dir}" PARENT_SCOPE)
set("${result}_build_interface_private_include_dir"
"${${result}_build_interface_private_include_dir}" PARENT_SCOPE)
# Setting module install interface directories in parent scope
set(repo_install_interface_include_dir "${repo_install_interface_include_dir}" PARENT_SCOPE)
set("${result}_install_interface_include_dir"
"${${result}_install_interface_include_dir}" PARENT_SCOPE)
set("${result}_install_interface_versioned_include_dir"
"${${result}_install_interface_versioned_include_dir}" PARENT_SCOPE)
set("${result}_install_interface_versioned_inner_include_dir"
"${${result}_install_interface_versioned_inner_include_dir}" PARENT_SCOPE)
set("${result}_install_interface_private_include_dir"
"${${result}_install_interface_private_include_dir}" PARENT_SCOPE)
endfunction() endfunction()
# Generate a module description file based on the template in ModuleDescription.json.in # Generate a module description file based on the template in ModuleDescription.json.in

View File

@ -1,6 +1,6 @@
function(qt_internal_write_depends_file module) function(qt_internal_write_depends_file target module_include_name)
set(outfile "${QT_BUILD_DIR}/include/${module}/${module}Depends") set(outfile "${QT_BUILD_DIR}/include/${module_include_name}/${module_include_name}Depends")
set(contents "/* This file was generated by cmake with the info from ${module} target. */\n") set(contents "/* This file was generated by cmake with the info from ${target} target. */\n")
string(APPEND contents "#ifdef __cplusplus /* create empty PCH in C mode */\n") string(APPEND contents "#ifdef __cplusplus /* create empty PCH in C mode */\n")
foreach (m ${ARGN}) foreach (m ${ARGN})
string(APPEND contents "# include <${m}/${m}>\n") string(APPEND contents "# include <${m}/${m}>\n")
@ -249,8 +249,8 @@ function(qt_internal_create_module_depends_file target)
get_target_property(hasModuleHeaders "${target}" _qt_module_has_headers) get_target_property(hasModuleHeaders "${target}" _qt_module_has_headers)
if (${hasModuleHeaders}) if (${hasModuleHeaders})
get_target_property(module_include_name "${target}" INTERFACE_MODULE_INCLUDE_NAME) get_target_property(module_include_name "${target}" _qt_module_include_name)
qt_internal_write_depends_file(${module_include_name} ${qtdeps}) qt_internal_write_depends_file(${target} ${module_include_name} ${qtdeps})
endif() endif()
if(third_party_deps OR main_module_tool_deps OR target_deps) if(third_party_deps OR main_module_tool_deps OR target_deps)

View File

@ -340,7 +340,8 @@ ${framework_base_path}/${fw_private_module_header_dir}")
else() else()
set(public_module_includes "$$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/${module}") set(public_module_includes "$$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/${module}")
set(public_module_frameworks "") set(public_module_frameworks "")
set(private_module_includes "$$QT_MODULE_INCLUDE_BASE/${module}/${PROJECT_VERSION} $$QT_MODULE_INCLUDE_BASE/${module}/${PROJECT_VERSION}/${module}") set(private_module_includes "$$QT_MODULE_INCLUDE_BASE/${module_versioned_include_dir} \
$$QT_MODULE_INCLUDE_BASE/${module_versioned_inner_include_dir}")
endif() endif()
if(arg_HEADER_MODULE) if(arg_HEADER_MODULE)

View File

@ -77,14 +77,14 @@ function(qt_install_injections target build_dir install_dir)
# This describes a concrete example for easier comprehension: # This describes a concrete example for easier comprehension:
# A file 'qtqml-config.h' is generated by qt_internal_feature_write_file into # A file 'qtqml-config.h' is generated by qt_internal_feature_write_file into
# ${qtdeclarative_build_dir}/src/{module}/qtqml-config.h (part 1). # ${qtdeclarative_build_dir}/src/{module_include_name}/qtqml-config.h (part 1).
# #
# Generate a lower case forwarding header (part 2) 'qtqml-config.h' at the following # Generate a lower case forwarding header (part 2) 'qtqml-config.h' at the following
# location: # location:
# ${some_prefix}/include/${module}/qtqml-config.h. # ${some_prefix}/include/${module_include_name}/qtqml-config.h.
# #
# Inside this file, we #include the originally generated file, # Inside this file, we #include the originally generated file,
# ${qtdeclarative_build_dir}/src/{module}/qtqml-config.h. # ${qtdeclarative_build_dir}/src/{module_include_name}/qtqml-config.h.
# #
# ${some_prefix}'s value depends on the build type. # ${some_prefix}'s value depends on the build type.
# If doing a prefix build, it should point to # If doing a prefix build, it should point to
@ -93,7 +93,7 @@ function(qt_install_injections target build_dir install_dir)
# ${qtbase_build_dir}. # ${qtbase_build_dir}.
# #
# In the code below, ${some_prefix} == ${build_dir}. # In the code below, ${some_prefix} == ${build_dir}.
set(lower_case_forwarding_header_path "${build_dir}/include/${module}") set(lower_case_forwarding_header_path "${build_dir}/include/${module_include_name}")
if(destinationdir) if(destinationdir)
string(APPEND lower_case_forwarding_header_path "/${destinationdir}") string(APPEND lower_case_forwarding_header_path "/${destinationdir}")
endif() endif()
@ -120,7 +120,8 @@ function(qt_install_injections target build_dir install_dir)
# to its install location when doing a prefix build. In an non-prefix build, the qt_install # to its install location when doing a prefix build. In an non-prefix build, the qt_install
# will be a no-op. # will be a no-op.
qt_path_join(install_destination qt_path_join(install_destination
${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) ${install_dir} ${INSTALL_INCLUDEDIR}
${module_include_name} ${destinationdir})
qt_install(FILES ${current_repo_build_dir}/${file} qt_install(FILES ${current_repo_build_dir}/${file}
DESTINATION ${install_destination} DESTINATION ${install_destination}
RENAME ${destinationname} OPTIONAL) RENAME ${destinationname} OPTIONAL)
@ -128,7 +129,7 @@ function(qt_install_injections target build_dir install_dir)
# Generate UpperCaseNamed forwarding headers (part 3). # Generate UpperCaseNamed forwarding headers (part 3).
foreach(fwd_hdr ${fwd_hdrs}) foreach(fwd_hdr ${fwd_hdrs})
set(upper_case_forwarding_header_path "include/${module}") set(upper_case_forwarding_header_path "include/${module_include_name}")
if(destinationdir) if(destinationdir)
string(APPEND upper_case_forwarding_header_path "/${destinationdir}") string(APPEND upper_case_forwarding_header_path "/${destinationdir}")
endif() endif()
@ -143,7 +144,8 @@ function(qt_install_injections target build_dir install_dir)
"${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}") "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}")
else() else()
# Install the forwarding header. # Install the forwarding header.
qt_path_join(install_destination "${install_dir}" "${INSTALL_INCLUDEDIR}" ${module}) qt_path_join(install_destination "${install_dir}" "${INSTALL_INCLUDEDIR}"
${module_include_name})
qt_install(FILES "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}" qt_install(FILES "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}"
DESTINATION ${install_destination} OPTIONAL) DESTINATION ${install_destination} OPTIONAL)
endif() endif()
@ -191,7 +193,7 @@ function(qt_compute_injection_forwarding_header target)
file(RELATIVE_PATH relpath "${PROJECT_BINARY_DIR}" "${source_absolute_path}") file(RELATIVE_PATH relpath "${PROJECT_BINARY_DIR}" "${source_absolute_path}")
if (arg_PRIVATE) if (arg_PRIVATE)
set(fwd "${PROJECT_VERSION}/${module}/private/${file_name}") set(fwd "${PROJECT_VERSION}/${module_include_name}/private/${file_name}")
else() else()
set(fwd "${file_name}") set(fwd "${file_name}")
endif() endif()