Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
333973b8
Commit
333973b8
authored
Apr 10, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11276 from alalek:install_pdb
parents
fa4b9e80
784c8436
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
23 deletions
+30
-23
CMakeLists.txt
3rdparty/protobuf/CMakeLists.txt
+2
-0
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+28
-23
No files found.
3rdparty/protobuf/CMakeLists.txt
View file @
333973b8
...
...
@@ -142,6 +142,8 @@ set_target_properties(libprotobuf
FOLDER
"3rdparty"
OUTPUT_NAME libprotobuf
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
COMPILE_PDB_NAME libprotobuf
COMPILE_PDB_NAME_DEBUG
"libprotobuf
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
3P_LIBRARY_OUTPUT_PATH
}
)
...
...
cmake/OpenCVUtils.cmake
View file @
333973b8
...
...
@@ -1027,14 +1027,17 @@ function(ocv_install_target)
set
(
${
__package
}
_TARGETS
"
${${
__package
}
_TARGETS
}
"
CACHE INTERNAL
"List of
${
__package
}
targets"
)
endif
()
if
(
MSVS
)
if
(
NOT INSTALL_IGNORE_PDB AND
(
INSTALL_PDB OR
(
INSTALL_CREATE_DISTRIB AND NOT BUILD_SHARED_LIBS
)
))
if
(
MSVC
)
if
(
INSTALL_PDB
AND
(
NOT INSTALL_IGNORE_PDB
))
set
(
__target
"
${
ARGV0
}
"
)
set
(
isArchive 0
)
set
(
__location_key
"ARCHIVE"
)
# static libs
get_target_property
(
__target_type
${
__target
}
TYPE
)
if
(
"
${
__target_type
}
"
STREQUAL
"SHARED_LIBRARY"
)
set
(
__location_key
"RUNTIME"
)
# shared libs (.DLL)
endif
()
set
(
processDst 0
)
set
(
isDst 0
)
unset
(
__dst
)
foreach
(
e
${
ARGN
}
)
...
...
@@ -1042,34 +1045,36 @@ function(ocv_install_target)
set
(
__dst
"
${
e
}
"
)
break
()
endif
()
if
(
isArchive
EQUAL 1 AND e STREQUAL
"DESTINATION"
)
if
(
processDst
EQUAL 1 AND e STREQUAL
"DESTINATION"
)
set
(
isDst 1
)
endif
()
if
(
e STREQUAL
"
ARCHIVE
"
)
set
(
isArchive
1
)
if
(
e STREQUAL
"
${
__location_key
}
"
)
set
(
processDst
1
)
else
()
set
(
isArchive
0
)
set
(
processDst
0
)
endif
()
endforeach
()
# message(STATUS "Process ${__target} dst=${__dst}...")
if
(
DEFINED __dst
)
# If CMake version is >=3.1.0 or <2.8.12.
if
(
NOT CMAKE_VERSION VERSION_LESS 3.1.0 OR CMAKE_VERSION VERSION_LESS 2.8.12
)
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 OPTIONAL
)
if
(
NOT CMAKE_VERSION VERSION_LESS 3.1.0
)
set
(
__pdb_install_component
"pdb"
)
if
(
DEFINED INSTALL_PDB_COMPONENT AND INSTALL_PDB_COMPONENT
)
set
(
__pdb_install_component
"
${
INSTALL_PDB_COMPONENT
}
"
)
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 OPTIONAL
)
# message(STATUS "Adding PDB file installation rule: target=${__target} dst=${__dst} component=${__pdb_install_component}")
if
(
"
${
__target_type
}
"
STREQUAL
"SHARED_LIBRARY"
)
install
(
FILES
"$<TARGET_PDB_FILE:
${
__target
}
>"
DESTINATION
"
${
__dst
}
"
COMPONENT
${
__pdb_install_component
}
OPTIONAL
)
else
()
# There is no generator expression similar to TARGET_PDB_FILE and TARGET_PDB_FILE can't be used: https://gitlab.kitware.com/cmake/cmake/issues/16932
# However we still want .pdb files like: 'lib/Debug/opencv_core341d.pdb' or '3rdparty/lib/zlibd.pdb'
install
(
FILES
"$<TARGET_PROPERTY:
${
__target
}
,ARCHIVE_OUTPUT_DIRECTORY>/$<CONFIG>/$<IF:$<BOOL:$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME_DEBUG>>,$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME_DEBUG>,$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME>>.pdb"
DESTINATION
"
${
__dst
}
"
CONFIGURATIONS Debug COMPONENT
${
__pdb_install_component
}
OPTIONAL
)
install
(
FILES
"$<TARGET_PROPERTY:
${
__target
}
,ARCHIVE_OUTPUT_DIRECTORY>/$<CONFIG>/$<IF:$<BOOL:$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME_RELEASE>>,$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME_RELEASE>,$<TARGET_PROPERTY:
${
__target
}
,COMPILE_PDB_NAME>>.pdb"
DESTINATION
"
${
__dst
}
"
CONFIGURATIONS Release COMPONENT
${
__pdb_install_component
}
OPTIONAL
)
endif
()
else
()
# CMake 2.8.12 broke PDB support for STATIC libraries from MSVS, fix was introduced in CMake 3.1.0.
message
(
WARNING
"PDB's are not supported from this version of CMake, use CMake version later then 3.1.0 or before 2.8.12."
)
message
(
WARNING
"PDB files installation is not supported (need CMake >= 3.1.0)"
)
endif
()
endif
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment