From ebe4eab477acba7b65b1465f38e9d8fd4646b602 Mon Sep 17 00:00:00 2001 From: Steve-o Date: Fri, 12 Oct 2012 16:49:15 +0000 Subject: [PATCH] Detect compiler version to tag libraries. --- CMakeLists.txt | 10 +++++----- cmake/Modules/TestZMQVersion.cmake | 10 +++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d812b9ed..e9f34ebf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,15 +242,15 @@ endforeach (txt ${docs}) add_library(libzmq SHARED ${sources} ${html-docs} ${CMAKE_BINARY_DIR}/NSIS.template.in) target_link_libraries(libzmq ws2_32.lib rpcrt4.lib) -set_target_properties(libzmq PROPERTIES RELEASE_POSTFIX "-v100-mt" DEBUG_POSTFIX "-v100-mt-gd") +set_target_properties(libzmq PROPERTIES RELEASE_POSTFIX "${_zmq_COMPILER}-mt" DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd") if (CMAKE_BUILD_TYPE STREQUAL "Debug") - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq-v100-mt-gd.dll DESTINATION bin COMPONENT SDK) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq-v100-mt-gd.lib DESTINATION lib COMPONENT SDK) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq-v100-mt-gd.pdb DESTINATION lib COMPONENT SDK) + install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.dll DESTINATION bin COMPONENT SDK) + install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.lib DESTINATION lib COMPONENT SDK) + install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt-gd.pdb DESTINATION lib COMPONENT SDK) else (CMAKE_BUILD_TYPE STREQUAL "Debug") install (TARGETS libzmq RUNTIME DESTINATION bin COMPONENT Runtime) - install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq-v100-mt.lib DESTINATION lib COMPONENT SDK) + install (FILES ${CMAKE_BINARY_DIR}/lib/libzmq${_zmq_COMPILER}-mt.lib DESTINATION lib COMPONENT SDK) endif (CMAKE_BUILD_TYPE STREQUAL "Debug") install (FILES ${headers} DESTINATION include COMPONENT SDK) diff --git a/cmake/Modules/TestZMQVersion.cmake b/cmake/Modules/TestZMQVersion.cmake index cb365e59..50606d3e 100644 --- a/cmake/Modules/TestZMQVersion.cmake +++ b/cmake/Modules/TestZMQVersion.cmake @@ -24,4 +24,12 @@ MESSAGE(STATUS "Detecting ZMQ - failed") ENDIF() - + if (MSVC11) + set(_zmq_COMPILER "-v110") + elseif (MSVC10) + set(_zmq_COMPILER "-v100") + elseif (MSVC90) + set(_zmq_COMPILER "-v90") + else() + set(_zmq_COMPILER "") + endif()