summaryrefslogtreecommitdiff
path: root/lib/cpp
diff options
context:
space:
mode:
authorTobias Weihs <t.weihs@mint-medical.de>2022-08-19 10:49:51 +0200
committerTobias Weihs <t.weihs@mint-medical.de>2022-09-11 18:38:08 +0200
commitfe73972ba61ca2c5fd7ebe3df1fb2aa285a09a9c (patch)
tree49b2ce639ccbc09af94621bc3598072a27188345 /lib/cpp
parent72d5912424211561adc6f8e7bc502180631d9f8e (diff)
downloadthrift-fe73972ba61ca2c5fd7ebe3df1fb2aa285a09a9c.tar.gz
prefer openssl and zlib targets over library paths
Diffstat (limited to 'lib/cpp')
-rw-r--r--lib/cpp/CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index 13b41c5c6..6a66e5ad1 100644
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -182,11 +182,17 @@ endif()
if(WITH_ZLIB)
find_package(ZLIB REQUIRED)
- include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
ADD_LIBRARY_THRIFT(thriftz ${thriftcppz_SOURCES})
target_link_libraries(thriftz PUBLIC thrift)
- target_link_libraries(thriftz PUBLIC ${ZLIB_LIBRARIES})
+
+ if(TARGET ZLIB::ZLIB)
+ target_link_libraries(thriftz PUBLIC ZLIB::ZLIB)
+ else()
+ include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
+ target_link_libraries(thriftz PUBLIC ${ZLIB_LIBRARIES})
+ endif()
+
ADD_PKGCONFIG_THRIFT(thrift-z)
endif()