add macro POCO_INSTALL_PDB to install MSVC pdb files

This commit is contained in:
Philip Miller 2015-06-02 12:05:15 -04:00
parent 2efe9b05cb
commit f918793228

View File

@ -250,4 +250,31 @@ install(
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
INCLUDES DESTINATION include INCLUDES DESTINATION include
) )
# install the targets pdb
POCO_INSTALL_PDB(${target_name})
endmacro()
# POCO_INSTALL_PDB - Install the given target's companion pdb file (if present)
# Usage: POCO_INSTALL_PDB(target_name)
# INPUT:
# target_name the name of the target. e.g. Foundation for PocoFoundation
# Example: POCO_INSTALL_PDB(Foundation)
#
# This is an internal macro meant only to be used by POCO_INSTALL.
macro(POCO_INSTALL_PDB target_name)
if (NOT MSVC)
return()
endif()
get_property(type TARGET ${target_name} PROPERTY TYPE)
if ("${type}" STREQUAL "SHARED_LIBRARY" OR "${type}" STREQUAL "EXECUTABLE")
install(
FILES $<TARGET_PDB_FILE:${target_name}>
DESTINATION bin
COMPONENT Devel
OPTIONAL
)
endif()
endmacro() endmacro()