summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Nikulov <sergey.nikulov@gmail.com>2015-09-02 13:06:22 +0300
committerRoger Meier <roger@apache.org>2015-09-08 23:22:44 +0200
commit34e0bb64bda3f7163e715fab09d014696deefa9c (patch)
tree78e7996ff71095024435da6a04a7b09a2d0f1860
parent5bc8b5a3a5da507b6f87436ca629be664496a69f (diff)
downloadthrift-34e0bb64bda3f7163e715fab09d014696deefa9c.tar.gz
THRIFT-2850 CMake for Apache Thrift
fixes for std/boost::thread detection; security test; qt test This closes #598
-rw-r--r--build/cmake/DefineOptions.cmake4
-rw-r--r--lib/cpp/test/CMakeLists.txt23
-rw-r--r--lib/cpp/test/qt/CMakeLists.txt8
3 files changed, 21 insertions, 14 deletions
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index d336c5019..62e240f36 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)
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index 9913f6c92..5de9fc4a1 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)
diff --git a/lib/cpp/test/qt/CMakeLists.txt b/lib/cpp/test/qt/CMakeLists.txt
index 00f2ddb45..7f341cc4c 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)