Fix the naming of the config header files for private modules

Perform a file name of the config header before adding a '_private'
suffix.

TODO: It makes sense to revisit the use of the CONFIG_MODULE_NAME
variable since the variable is used for different purposes and
mutate with use.

Amends 8aee7c6b29

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: Id5aaf8d423ec8b94afffe4641b54dab94b5453fb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2021-06-18 20:13:32 +02:00 committed by Alexey Edelev
parent fe6d84d96e
commit ed92cb30e4

View File

@ -131,6 +131,9 @@ function(qt_internal_add_module target)
set(arg_CONFIG_MODULE_NAME "${module_lower}")
endif()
set(module_config_header "qt${arg_CONFIG_MODULE_NAME}-config.h")
set(module_config_private_header "qt${arg_CONFIG_MODULE_NAME}-config_p.h")
# Module define needs to take into account the config module name.
string(TOUPPER "${arg_CONFIG_MODULE_NAME}" module_define_infix)
string(REPLACE "-" "_" module_define_infix "${module_define_infix}")
@ -499,16 +502,20 @@ function(qt_internal_add_module target)
if(EXISTS "${configureFile}" AND NOT arg_NO_CONFIG_HEADER_FILE)
qt_feature_module_begin(
LIBRARY "${target}"
PUBLIC_FILE "qt${arg_CONFIG_MODULE_NAME}-config.h"
PRIVATE_FILE "qt${arg_CONFIG_MODULE_NAME}-config_p.h"
PUBLIC_FILE "${module_config_header}"
PRIVATE_FILE "${module_config_private_header}"
PUBLIC_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES}
PRIVATE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES}
)
include(${configureFile})
qt_feature_module_end("${target}")
set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config.h")
set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config_p.h")
set_property(TARGET "${target}" APPEND PROPERTY
PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${module_config_header}"
)
set_property(TARGET "${target}" APPEND PROPERTY
PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${module_config_private_header}"
)
endif()
if(NOT arg_HEADER_MODULE)