diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt index c29ebaf4396..8f332cebad3 100755 --- a/lib/cpp/CMakeLists.txt +++ b/lib/cpp/CMakeLists.txt @@ -24,6 +24,8 @@ set(SYSLIBS "") set(package_deps Boost) set(boost_components) +list(APPEND SYSLIBS Boost::boost) + # Create the thrift C++ library set( thriftcpp_SOURCES src/thrift/TApplicationException.cpp @@ -109,7 +111,6 @@ if(WITH_BOOSTTHREADS) src/thrift/concurrency/BoostMonitor.cpp src/thrift/concurrency/BoostMutex.cpp ) - list(APPEND SYSLIBS "${Boost_LIBRARIES}") list(APPEND boost_components thread) elseif(UNIX AND NOT WITH_STDTHREADS) if(ANDROID) @@ -165,9 +166,9 @@ include(ThriftMacros) ADD_LIBRARY_THRIFT(thrift ${thriftcpp_SOURCES} ${thriftcpp_threads_SOURCES}) if(WIN32) - TARGET_LINK_LIBRARIES_THRIFT(thrift ${SYSLIBS} ws2_32) + TARGET_LINK_LIBRARIES_THRIFT(thrift PUBLIC ${SYSLIBS} ws2_32) else() - TARGET_LINK_LIBRARIES_THRIFT(thrift ${SYSLIBS}) + TARGET_LINK_LIBRARIES_THRIFT(thrift PUBLIC ${SYSLIBS}) endif() if(WITH_LIBEVENT)