Browse Source

Merge topic 'FindProtobuf-threads'

ae41216878 FindProtobuf: Link to threads dependency only when Protobuf is found

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5251
Brad King 5 years ago
parent
commit
c9a3ae1356
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/FindProtobuf.cmake

+ 1 - 1
Modules/FindProtobuf.cmake

@@ -388,7 +388,7 @@ function(_protobuf_find_libraries name filename)
 
 
     select_library_configurations(${name})
     select_library_configurations(${name})
 
 
-    if(UNIX AND Threads_FOUND)
+    if(UNIX AND Threads_FOUND AND ${name}_LIBRARY)
       list(APPEND ${name}_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
       list(APPEND ${name}_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
     endif()
     endif()