Repository: thrift Updated Branches: refs/heads/master 5bc8b5a3a -> 34e0bb64b
THRIFT-2850 CMake for Apache Thrift fixes for std/boost::thread detection; security test; qt test This closes #598 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/34e0bb64 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/34e0bb64 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/34e0bb64 Branch: refs/heads/master Commit: 34e0bb64bda3f7163e715fab09d014696deefa9c Parents: 5bc8b5a Author: Sergei Nikulov <[email protected]> Authored: Wed Sep 2 13:06:22 2015 +0300 Committer: Roger Meier <[email protected]> Committed: Tue Sep 8 23:22:44 2015 +0200 ---------------------------------------------------------------------- build/cmake/DefineOptions.cmake | 4 +++- lib/cpp/test/CMakeLists.txt | 23 ++++++++++++----------- lib/cpp/test/qt/CMakeLists.txt | 8 ++++++-- 3 files changed, 21 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/34e0bb64/build/cmake/DefineOptions.cmake ---------------------------------------------------------------------- diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index d336c50..62e240f 100644 --- a/build/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake @@ -62,8 +62,10 @@ endif() find_package(OpenSSL QUIET) CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON "OPENSSL_FOUND" OFF) -option(WITH_BOOSTTHREADS "Build with Boost thread support" OFF) option(WITH_STDTHREADS "Build with C++ std::thread support" OFF) +CMAKE_DEPENDENT_OPTION(WITH_BOOSTTHREADS "Build with Boost threads support" OFF + "NOT WITH_STDTHREADS;Boost_FOUND" OFF) + # C GLib option(WITH_C_GLIB "Build C (GLib) Thrift library" ON) http://git-wip-us.apache.org/repos/asf/thrift/blob/34e0bb64/lib/cpp/test/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt index 9913f6c..5de9fc4 100644 --- a/lib/cpp/test/CMakeLists.txt +++ b/lib/cpp/test/CMakeLists.txt @@ -117,17 +117,6 @@ target_link_libraries(TServerIntegrationTest -lrt) endif () add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest) -add_executable(SecurityTest SecurityTest.cpp) -target_link_libraries(SecurityTest - testgencpp - ${Boost_LIBRARIES} -) -LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift) -if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -target_link_libraries(SecurityTest -lrt) -endif () -add_test(NAME SecurityTest COMMAND SecurityTest "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys") - if(WITH_ZLIB) add_executable(TransportTest TransportTest.cpp) target_link_libraries(TransportTest @@ -301,6 +290,18 @@ target_link_libraries(OpenSSLManualInitTest ) LINK_AGAINST_THRIFT_LIBRARY(OpenSSLManualInitTest thrift) add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest) + +add_executable(SecurityTest SecurityTest.cpp) +target_link_libraries(SecurityTest + testgencpp + ${Boost_LIBRARIES} +) +LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift) +if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +target_link_libraries(SecurityTest -lrt) +endif () +add_test(NAME SecurityTest COMMAND SecurityTest "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys") + endif() if(WITH_QT4) http://git-wip-us.apache.org/repos/asf/thrift/blob/34e0bb64/lib/cpp/test/qt/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/lib/cpp/test/qt/CMakeLists.txt b/lib/cpp/test/qt/CMakeLists.txt index 00f2ddb..7f341cc 100644 --- a/lib/cpp/test/qt/CMakeLists.txt +++ b/lib/cpp/test/qt/CMakeLists.txt @@ -18,11 +18,15 @@ # set(CMAKE_AUTOMOC ON) -find_package(Qt5 REQUIRED COMPONENTS Test) +find_package(Qt5 REQUIRED COMPONENTS Test Network) set(TQTcpServerTest_Qt5_SOURCES TQTcpServerTest.cpp ) add_executable(TQTcpServerTest_Qt5 ${TQTcpServerTest_Qt5_SOURCES}) -target_link_libraries(TQTcpServerTest_Qt5 testgencpp_cob thriftqt5 thrift Qt5::Test) +target_link_libraries(TQTcpServerTest_Qt5 testgencpp_cob) +LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest_Qt5 thriftqt5) +LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest_Qt5 thrift) +target_link_libraries(TQTcpServerTest_Qt5 Qt5::Test Qt5::Network) + add_test(NAME TQTcpServerTest_Qt5 COMMAND TQTcpServerTest_Qt5)
