diff options
author | Brad King <brad.king@kitware.com> | 2019-07-19 16:05:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-19 16:05:31 (GMT) |
commit | a6cc72595f01b517bc54b8b745c2eacf2a38c160 (patch) | |
tree | ba5750c9a40d2dbff66416c021262b438c6e9457 /Modules | |
parent | aa5ec6f42cc3a3ab8b36eb9cb87ea86709cec7f4 (diff) | |
parent | 3bbd85d5fffe66181cf16c81b23b2ba50f5387ba (diff) | |
download | CMake-a6cc72595f01b517bc54b8b745c2eacf2a38c160.zip CMake-a6cc72595f01b517bc54b8b745c2eacf2a38c160.tar.gz CMake-a6cc72595f01b517bc54b8b745c2eacf2a38c160.tar.bz2 |
Merge topic 'FindProtobuf-DLLs'
3bbd85d5ff FindProtobuf: Fix usage of protobuf dynamic libraries on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3555
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindProtobuf.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 670352c..2d45965 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -526,6 +526,11 @@ if(Protobuf_INCLUDE_DIR) INTERFACE_COMPILE_FEATURES cxx_std_11 ) endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotobuf APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotobuf APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) @@ -554,6 +559,11 @@ if(Protobuf_INCLUDE_DIR) set_target_properties(protobuf::libprotobuf-lite PROPERTIES IMPORTED_LOCATION_DEBUG "${Protobuf_LITE_LIBRARY_DEBUG}") endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) @@ -587,6 +597,11 @@ if(Protobuf_INCLUDE_DIR) INTERFACE_COMPILE_FEATURES cxx_std_11 ) endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotoc APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotoc APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) |