mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-17 08:34:00 +00:00
CMake: Linker PDB install rule does not work when Visual Studio generators are used (#3040)
* Fixes issues with the PDB install rule for VS solutions * Fix for compile PDB and linker PDB under Windows
This commit is contained in:
parent
02eefb41ad
commit
bb4fb32925
@ -478,6 +478,9 @@ if (MSVC)
|
|||||||
# Parallel make.
|
# Parallel make.
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
|
|
||||||
|
# Compile the static lib with debug information included
|
||||||
|
string (REGEX REPLACE "/Z." "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||||
|
|
||||||
# Optimization flags.
|
# Optimization flags.
|
||||||
# http://msdn.microsoft.com/en-us/magazine/cc301698.aspx
|
# http://msdn.microsoft.com/en-us/magazine/cc301698.aspx
|
||||||
if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||||
@ -890,6 +893,8 @@ if (MSVC)
|
|||||||
# Suppress linker warnings caused by #ifdef omission
|
# Suppress linker warnings caused by #ifdef omission
|
||||||
# of file content.
|
# of file content.
|
||||||
set( CMAKE_STATIC_LINKER_FLAGS /ignore:4221 )
|
set( CMAKE_STATIC_LINKER_FLAGS /ignore:4221 )
|
||||||
|
set (PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||||
|
set (PDB_NAME "libzmq${MSVC_TOOLSET}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}")
|
||||||
if (BUILD_SHARED)
|
if (BUILD_SHARED)
|
||||||
add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
set_target_properties (libzmq PROPERTIES
|
set_target_properties (libzmq PROPERTIES
|
||||||
@ -1115,17 +1120,12 @@ if (MSVC)
|
|||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
COMPONENT SDK)
|
COMPONENT SDK)
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if (MSVC_IDE)
|
||||||
install (TARGETS ${target_outputs}
|
install (FILES ${PDB_OUTPUT_DIRECTORY}/\${CMAKE_INSTALL_CONFIG_NAME}/${PDB_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT SDK OPTIONAL)
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
else()
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
install (FILES ${PDB_OUTPUT_DIRECTORY}/${PDB_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT SDK OPTIONAL)
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
endif()
|
||||||
COMPONENT SDK)
|
if (BUILD_SHARED)
|
||||||
if (NOT CMAKE_PDB_OUTPUT_DIRECTORY AND BUILD_SHARED)
|
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/libzmq${MSVC_TOOLSET}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}.pdb DESTINATION lib
|
|
||||||
COMPONENT SDK)
|
|
||||||
endif ()
|
|
||||||
elseif (BUILD_SHARED)
|
|
||||||
install (TARGETS libzmq
|
install (TARGETS libzmq
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user