CMake: Fix file names of metatypes JSON files

The file names included the build type in the case of a single-config
build. The intention was to include the build type in multi-config
builds to make those more robust. This is not necessary since the
metatypes JSON files are independent of any configurations.

Fixes: QTBUG-136574
Change-Id: I4925e37c784f678e0d311fa9aba9f195b3270f94
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Joerg Bornemann 2025-05-05 08:30:10 +02:00
parent 9f4d74ece8
commit 22b7d198ce
2 changed files with 2 additions and 11 deletions

View File

@ -1422,12 +1422,7 @@ function(qt6_extract_metatypes target)
message(FATAL_ERROR "Metatype generation requires either the use of AUTOMOC or a manual list of generated json files")
endif()
if (CMAKE_BUILD_TYPE AND NOT is_multi_config)
string(TOLOWER ${target}_${CMAKE_BUILD_TYPE} target_lowercase)
else()
string(TOLOWER ${target} target_lowercase)
endif()
string(TOLOWER ${target} target_lowercase)
set(metatypes_file_name "qt6${target_lowercase}_metatypes.json")
set(metatypes_file "${target_binary_dir}/meta_types/${metatypes_file_name}")
set(metatypes_file_gen "${target_binary_dir}/meta_types/${metatypes_file_name}.gen")

View File

@ -13,11 +13,7 @@ get_filename_component(test_project_source_dir "${test_project_source_dir}" REAL
get_filename_component(test_project_build_dir "${test_project_build_dir}" REALPATH)
get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG)
if (CMAKE_BUILD_TYPE AND NOT is_multi_config)
string(TOLOWER "qt6metatypetest_${CMAKE_BUILD_TYPE}" metatypes_file_basename)
else()
string(TOLOWER "qt6metatypetest" metatypes_file_basename)
endif()
string(TOLOWER "qt6metatypetest" metatypes_file_basename)
set(meta_types_file
"${test_project_build_dir}/meta_types/${metatypes_file_basename}_metatypes.json")