From c65a27213af5ea1ff0e4df91aef02a23c68c7ddd Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Thu, 19 Jan 2017 10:59:47 +0100 Subject: [PATCH] Problem: name of static library generated by cmake differs from the behavior of kernel. Solution: Change the target output name from libzmq-static to libzmq. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 314a3b50..89bcd52d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -731,6 +731,8 @@ if (MSVC) RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" COMPILE_DEFINITIONS "DLL_EXPORT") add_library (libzmq-static STATIC ${sources}) + # NOTE: on windows platform the static library name cannot be the same as the shared library name. + # since the .dll also requires a .lib companion file for linking. set_target_properties (libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" RELEASE_POSTFIX "${MSVC_TOOLSET}-mt-s-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" @@ -765,7 +767,7 @@ else () set_target_properties (libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" COMPILE_DEFINITIONS "ZMQ_STATIC" - OUTPUT_NAME "libzmq-static" + OUTPUT_NAME "libzmq" PREFIX "") endif ()