THRIFT-2903 Qt4 library built with CMake does not work
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index cb68505..9a7d245 100644
--- a/lib/cpp/test/CMakeLists.txt
+++ b/lib/cpp/test/CMakeLists.txt
@@ -47,7 +47,7 @@
add_library(testgencpp STATIC ${testgencpp_SOURCES})
target_link_libraries(testgencpp thrift)
-set(processortest_SOURCES
+set(testgencpp_cob_SOURCES
gen-cpp/ChildService.cpp
gen-cpp/ChildService.h
gen-cpp/ParentService.cpp
@@ -55,6 +55,8 @@
gen-cpp/proc_types.cpp
gen-cpp/proc_types.h
)
+add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES})
+target_link_libraries(testgencpp_cob thrift)
add_executable(Benchmark Benchmark.cpp)
@@ -182,11 +184,13 @@
set(link_test_SOURCES
link/LinkTest.cpp
+ gen-cpp/ParentService.h
link/TemplatedService1.cpp
link/TemplatedService2.cpp
- gen-cpp/ParentService.h
)
+
add_executable(link_test ${link_test_SOURCES})
+target_link_libraries(concurrency_test testgencpp_cob thrift)
add_test(NAME link_test COMMAND link_test)
if(WITH_LIBEVENT)
@@ -200,6 +204,7 @@
)
add_executable(processor_test ${processor_test_SOURCES})
target_link_libraries(processor_test
+ testgencpp_cob
thrift
thriftnb
${Boost_LIBRARIES}
@@ -217,6 +222,18 @@
add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest)
endif()
+if(WITH_QT4)
+cmake_minimum_required(VERSION 2.8.12)
+set(CMAKE_AUTOMOC ON)
+find_package(Qt4 REQUIRED COMPONENTS QtTest)
+set(TQTcpServerTest_SOURCES
+ qt/TQTcpServerTest.cpp
+)
+add_executable(TQTcpServerTest ${TQTcpServerTest_SOURCES})
+target_link_libraries(TQTcpServerTest testgencpp_cob thriftqt thrift Qt4::QtTest)
+add_test(NAME TQTcpServerTest COMMAND TQTcpServerTest)
+endif()
+
#
# Common thrift code generation rules
#