Skip to content

Commit 22df206

Browse files
authored
Merge pull request opencv#7875 from alalek:winpack_fix_2.4
cmake: update PDB support condition
2 parents cc09f5a + b06bd50 commit 22df206

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cmake/OpenCVUtils.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,11 @@ function(ocv_install_target)
607607
set(${__package}_TARGETS "${${__package}_TARGETS}" CACHE INTERNAL "List of ${__package} targets")
608608
endif()
609609

610-
if(INSTALL_CREATE_DISTRIB)
611-
if(MSVC AND NOT BUILD_SHARED_LIBS)
610+
if(MSVS)
611+
if(NOT INSTALL_IGNORE_PDB AND
612+
(INSTALL_PDB OR
613+
(INSTALL_CREATE_DISTRIB AND NOT BUILD_SHARED_LIBS)
614+
))
612615
set(__target "${ARGV0}")
613616

614617
set(isArchive 0)
@@ -636,13 +639,13 @@ function(ocv_install_target)
636639
get_target_property(fname ${__target} LOCATION_DEBUG)
637640
if(fname MATCHES "\\.lib$")
638641
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
639-
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Debug)
642+
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Debug OPTIONAL)
640643
endif()
641644

642645
get_target_property(fname ${__target} LOCATION_RELEASE)
643646
if(fname MATCHES "\\.lib$")
644647
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
645-
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Release)
648+
install(FILES "${fname}" DESTINATION "${__dst}" CONFIGURATIONS Release OPTIONAL)
646649
endif()
647650
else()
648651
# CMake 2.8.12 broke PDB support for STATIC libraries from MSVS, fix was introduced in CMake 3.1.0.

0 commit comments

Comments
 (0)