cmake: update PDB support condition

Unfortunately there is no stable support for installation of PDB files in CMake.
This patch is just eliminate problems with modern versions.
This commit is contained in:
Alexander Alekhin 2016-12-14 14:49:19 +03:00
parent cc09f5a7de
commit b06bd50144

View File

@ -607,8 +607,11 @@ function(ocv_install_target)
set(${__package}_TARGETS "${${__package}_TARGETS}" CACHE INTERNAL "List of ${__package} targets")
endif()
if(INSTALL_CREATE_DISTRIB)
if(MSVC AND NOT BUILD_SHARED_LIBS)
if(MSVS)
if(NOT INSTALL_IGNORE_PDB AND
(INSTALL_PDB OR
(INSTALL_CREATE_DISTRIB AND NOT BUILD_SHARED_LIBS)
))
set(__target "${ARGV0}")
set(isArchive 0)
@ -636,13 +639,13 @@ function(ocv_install_target)
get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Debug)
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Debug OPTIONAL)
endif()
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Release)
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Release OPTIONAL)
endif()
else()
# CMake 2.8.12 broke PDB support for STATIC libraries from MSVS, fix was introduced in CMake 3.1.0.