diff --git a/cmake/Qt3rdPartyLibraryHelpers.cmake b/cmake/Qt3rdPartyLibraryHelpers.cmake index d562024ca3..1db4683c69 100644 --- a/cmake/Qt3rdPartyLibraryHelpers.cmake +++ b/cmake/Qt3rdPartyLibraryHelpers.cmake @@ -162,10 +162,6 @@ function(qt_internal_add_3rdparty_library target) qt_internal_add_common_qt_library_helper(${target} ${library_helper_args}) - if(NOT arg_INTERFACE) - qt_set_common_target_properties(${target}) - endif() - set_target_properties(${target} PROPERTIES _qt_module_interface_name "${target}" ) @@ -195,6 +191,10 @@ function(qt_internal_add_3rdparty_library target) OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}" ) + if(NOT arg_INTERFACE) + qt_set_common_target_properties(${target}) + endif() + if(NOT arg_SKIP_AUTOMOC) qt_autogen_tools_initial_setup(${target}) endif() diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 6821d1e19d..0d17d0b362 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -177,7 +177,6 @@ function(qt_internal_add_module target) set(property_prefix "INTERFACE_") if(NOT arg_HEADER_MODULE) - qt_set_common_target_properties(${target}) set(property_prefix "") endif() @@ -293,6 +292,8 @@ function(qt_internal_add_module target) ) endif() + qt_set_common_target_properties(${target}) + if (WIN32 AND BUILD_SHARED_LIBS) _qt_internal_generate_win32_rc_file(${target}) endif() diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index 49fbe0eed2..03ff7de1c9 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -117,7 +117,6 @@ function(qt_internal_add_plugin target) endif() endif() - qt_set_common_target_properties(${target}) qt_set_target_info_properties(${target} ${ARGN} TARGET_VERSION "${arg_VERSION}") # Override the OUTPUT_NAME that qt6_add_plugin() set, we need to account for @@ -139,6 +138,7 @@ function(qt_internal_add_plugin target) endif() endif() + qt_set_common_target_properties("${target}") qt_internal_add_target_aliases("${target}") qt_skip_warnings_are_errors_when_repo_unclean("${target}") _qt_internal_apply_strict_cpp("${target}") diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index 9640287ea9..b425d1bfa2 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -650,8 +650,12 @@ function(qt_internal_set_compile_pdb_names target) if(MSVC) get_target_property(target_type ${target} TYPE) if(target_type STREQUAL "STATIC_LIBRARY" OR target_type STREQUAL "OBJECT_LIBRARY") - set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME "${INSTALL_CMAKE_NAMESPACE}${target}") - set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME_DEBUG "${INSTALL_CMAKE_NAMESPACE}${target}d") + get_target_property(output_name ${target} OUTPUT_NAME) + if(NOT output_name) + set(output_name "${INSTALL_CMAKE_NAMESPACE}${target}") + endif() + set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME "${output_name}") + set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME_DEBUG "${output_name}d") endif() endif() endfunction() @@ -712,8 +716,9 @@ function(qt_internal_install_pdb_files target install_dir_path) "Can't install pdb file for static library ${target}. " "The ARCHIVE_OUTPUT_DIRECTORY path is not known.") endif() - set(pdb_name "${INSTALL_CMAKE_NAMESPACE}${target}$<$:d>.pdb") - qt_path_join(compile_time_pdb_file_path "${lib_dir}" "${pdb_name}") + get_target_property(pdb_name "${target}" COMPILE_PDB_NAME) + qt_path_join(compile_time_pdb_file_path + "${lib_dir}" "${pdb_name}$<$:d>.pdb") qt_install(FILES "${compile_time_pdb_file_path}" DESTINATION "${install_dir_path}" OPTIONAL) @@ -725,8 +730,9 @@ function(qt_internal_install_pdb_files target install_dir_path) qt_path_join(pdb_dir "${pdb_dir}" "$") endif() endif() - set(pdb_name "${INSTALL_CMAKE_NAMESPACE}${target}$<$:d>.pdb") - qt_path_join(compile_time_pdb_file_path "${pdb_dir}" "${pdb_name}") + get_target_property(pdb_name "${target}" COMPILE_PDB_NAME) + qt_path_join(compile_time_pdb_file_path + "${pdb_dir}" "${pdb_name}$<$:d>.pdb") qt_install(FILES "${compile_time_pdb_file_path}" DESTINATION "${install_dir_path}" OPTIONAL)