From 2ec87125a858d2762b20d662638aa02623c84dd9 Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Wed, 15 Nov 2017 07:43:53 -0500 Subject: [PATCH 1/2] Always add Boost library as required library --- lib/cpp/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt index c29ebaf4396..03df4e1b25e 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_LIBRARIES}") + # 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) From 17f24e085bc9f36f694149c1a4744c47dd012334 Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Wed, 15 Nov 2017 08:56:10 -0500 Subject: [PATCH 2/2] Link against Boost::boost for includes --- lib/cpp/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt index 03df4e1b25e..8f332cebad3 100755 --- a/lib/cpp/CMakeLists.txt +++ b/lib/cpp/CMakeLists.txt @@ -24,7 +24,7 @@ set(SYSLIBS "") set(package_deps Boost) set(boost_components) -list(APPEND SYSLIBS "${Boost_LIBRARIES}") +list(APPEND SYSLIBS Boost::boost) # Create the thrift C++ library set( thriftcpp_SOURCES @@ -166,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)