CMake: Install pdb files to proper directories in multi-config build
In multi-config build, for different configs, the pdb files of EXEs should have different installation directories. For example, when CMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug, <build_dir>/bin/moc.pdb will be installed to <install_dir>/bin/moc.pdb. <build_dir>/bin/Debug/moc.pdb should be installed to <install_dir>/bin/Debug/moc.pdb, not <install_dir>/bin/moc.pdb. Fixes: QTBUG-88268 Change-Id: Idc7c92ca8d44bb81d990656af2b309306a4f5c6b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
654156fb79
commit
215400e153
@ -554,8 +554,22 @@ function(qt_internal_install_pdb_files target install_dir_path)
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
get_target_property(target_type ${target} TYPE)
|
get_target_property(target_type ${target} TYPE)
|
||||||
|
|
||||||
if(target_type STREQUAL "SHARED_LIBRARY"
|
if(target_type STREQUAL "EXECUTABLE")
|
||||||
OR target_type STREQUAL "EXECUTABLE"
|
qt_get_cmake_configurations(cmake_configs)
|
||||||
|
list(LENGTH cmake_configs all_configs_count)
|
||||||
|
list(GET cmake_configs 0 first_config)
|
||||||
|
foreach(cmake_config ${cmake_configs})
|
||||||
|
set(suffix "")
|
||||||
|
if(all_configs_count GREATER 1 AND NOT cmake_config STREQUAL first_config)
|
||||||
|
set(suffix "/${cmake_config}")
|
||||||
|
endif()
|
||||||
|
qt_install(FILES "$<TARGET_PDB_FILE:${target}>"
|
||||||
|
CONFIGURATIONS ${cmake_config}
|
||||||
|
DESTINATION "${install_dir_path}${suffix}"
|
||||||
|
OPTIONAL)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
elseif(target_type STREQUAL "SHARED_LIBRARY"
|
||||||
OR target_type STREQUAL "MODULE_LIBRARY")
|
OR target_type STREQUAL "MODULE_LIBRARY")
|
||||||
qt_install(FILES "$<TARGET_PDB_FILE:${target}>"
|
qt_install(FILES "$<TARGET_PDB_FILE:${target}>"
|
||||||
DESTINATION "${install_dir_path}"
|
DESTINATION "${install_dir_path}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user