blob: 9b62cc9524c83fafa2c41ca3b139b2fa6e4166ae [file] [log] [blame]
James E. King, III82ae9572017-08-05 12:23:54 -04001#
Pascal Bachd5f87e12014-12-12 15:59:17 +01002# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
Nobuaki Sukegawac444fb52015-01-02 23:16:55 +090020include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
Pascal Bachd5f87e12014-12-12 15:59:17 +010021
James E. King, IIId7142b72017-09-01 13:00:36 -070022add_definitions("-D__STDC_FORMAT_MACROS")
James E. King, III7edc8fa2017-01-20 10:11:41 -050023add_definitions("-D__STDC_LIMIT_MACROS")
24
25if (WITH_DYN_LINK_TEST)
26 add_definitions( -DBOOST_TEST_DYN_LINK )
27endif()
28
29# Make sure gen-cpp files can be included
Pascal Bachd5f87e12014-12-12 15:59:17 +010030include_directories("${CMAKE_CURRENT_BINARY_DIR}")
31
32# Create the thrift C++ test library
33set(testgencpp_SOURCES
James E. King, IIIb4c190b2017-02-13 16:39:59 -050034 gen-cpp/AnnotationTest_types.cpp
35 gen-cpp/AnnotationTest_types.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010036 gen-cpp/DebugProtoTest_types.cpp
37 gen-cpp/DebugProtoTest_types.h
38 gen-cpp/EnumTest_types.cpp
39 gen-cpp/EnumTest_types.h
40 gen-cpp/OptionalRequiredTest_types.cpp
41 gen-cpp/OptionalRequiredTest_types.h
42 gen-cpp/Recursive_types.cpp
43 gen-cpp/Recursive_types.h
44 gen-cpp/ThriftTest_types.cpp
45 gen-cpp/ThriftTest_types.h
Chet Murthyad08a8b2017-12-19 15:55:56 -080046 gen-cpp/OneWayTest_types.cpp
47 gen-cpp/OneWayTest_types.h
48 gen-cpp/OneWayService.cpp
49 gen-cpp/OneWayService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010050 gen-cpp/TypedefTest_types.cpp
51 gen-cpp/TypedefTest_types.h
52 ThriftTest_extras.cpp
53 DebugProtoTest_extras.cpp
54)
55
56add_library(testgencpp STATIC ${testgencpp_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010057
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090058set(testgencpp_cob_SOURCES
Pascal Bachd5f87e12014-12-12 15:59:17 +010059 gen-cpp/ChildService.cpp
60 gen-cpp/ChildService.h
Ben Craig1684c422015-04-24 08:52:44 -050061 gen-cpp/EmptyService.cpp
62 gen-cpp/EmptyService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010063 gen-cpp/ParentService.cpp
64 gen-cpp/ParentService.h
65 gen-cpp/proc_types.cpp
66 gen-cpp/proc_types.h
67)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090068add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010069
Pascal Bachd5f87e12014-12-12 15:59:17 +010070add_executable(Benchmark Benchmark.cpp)
71target_link_libraries(Benchmark testgencpp)
Jim King9de9b1f2015-04-30 16:03:34 -040072LINK_AGAINST_THRIFT_LIBRARY(Benchmark thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010073add_test(NAME Benchmark COMMAND Benchmark)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090074target_link_libraries(Benchmark testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +010075
76set(UnitTest_SOURCES
77 UnitTestMain.cpp
Chet Murthyad08a8b2017-12-19 15:55:56 -080078 OneWayHTTPTest.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +010079 TMemoryBufferTest.cpp
80 TBufferBaseTest.cpp
81 Base64Test.cpp
82 ToStringTest.cpp
83 TypedefTest.cpp
Roger Meier3815e0b2015-04-04 16:26:30 +020084 TServerSocketTest.cpp
Ben Craig1684c422015-04-24 08:52:44 -050085 TServerTransportTest.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +010086)
87
James E. King, III07f59972017-03-10 06:18:33 -050088if(NOT WITH_BOOSTTHREADS AND NOT WITH_STDTHREADS AND NOT MSVC AND NOT MINGW)
James E. King, III00d42522017-04-04 09:32:45 -040089 list(APPEND UnitTest_SOURCES concurrency/MutexTest.cpp)
90 list(APPEND UnitTest_SOURCES concurrency/RWMutexStarveTest.cpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +010091endif()
92
93add_executable(UnitTests ${UnitTest_SOURCES})
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090094target_link_libraries(UnitTests testgencpp ${Boost_LIBRARIES})
Jim King9de9b1f2015-04-30 16:03:34 -040095LINK_AGAINST_THRIFT_LIBRARY(UnitTests thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010096add_test(NAME UnitTests COMMAND UnitTests)
ben-craigfae08e72015-07-15 11:34:47 -050097if ( MSVC )
98 # Disable C4503: decorated name length exceeded, name was truncated
99 # 'insanity' results in very long decorated names
100 set_property( TARGET UnitTests APPEND_STRING PROPERTY COMPILE_FLAGS /wd4503 )
101endif ( MSVC )
Pascal Bachd5f87e12014-12-12 15:59:17 +0100102
ben-craigaf2d9c82015-07-16 08:11:21 -0500103
Martin Haimberger0ad6ee92015-11-13 03:18:50 -0800104set( TInterruptTest_SOURCES
105 TSocketInterruptTest.cpp
106 TSSLSocketInterruptTest.cpp
107)
ben-craigaf2d9c82015-07-16 08:11:21 -0500108if (WIN32)
109 list(APPEND TInterruptTest_SOURCES
110 TPipeInterruptTest.cpp
111 )
112endif()
113add_executable(TInterruptTest ${TInterruptTest_SOURCES})
114target_link_libraries(TInterruptTest
Ben Craig1684c422015-04-24 08:52:44 -0500115 testgencpp
116 ${Boost_LIBRARIES}
Ben Craig1684c422015-04-24 08:52:44 -0500117)
ben-craigaf2d9c82015-07-16 08:11:21 -0500118LINK_AGAINST_THRIFT_LIBRARY(TInterruptTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100119if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
ben-craigaf2d9c82015-07-16 08:11:21 -0500120target_link_libraries(TInterruptTest -lrt)
Ben Craig1684c422015-04-24 08:52:44 -0500121endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500122add_test(NAME TInterruptTest COMMAND TInterruptTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Ben Craig1684c422015-04-24 08:52:44 -0500123
124add_executable(TServerIntegrationTest TServerIntegrationTest.cpp)
125target_link_libraries(TServerIntegrationTest
126 testgencpp_cob
127 ${Boost_LIBRARIES}
128)
Jim King9de9b1f2015-04-30 16:03:34 -0400129LINK_AGAINST_THRIFT_LIBRARY(TServerIntegrationTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100130if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Ben Craig1684c422015-04-24 08:52:44 -0500131target_link_libraries(TServerIntegrationTest -lrt)
132endif ()
133add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100134
135if(WITH_ZLIB)
Nobuaki Sukegawa3e5b9c22016-02-22 21:47:23 +0900136include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
Pascal Bachd5f87e12014-12-12 15:59:17 +0100137add_executable(TransportTest TransportTest.cpp)
138target_link_libraries(TransportTest
139 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100140 ${Boost_LIBRARIES}
141 ${ZLIB_LIBRARIES}
142)
Jim King9de9b1f2015-04-30 16:03:34 -0400143LINK_AGAINST_THRIFT_LIBRARY(TransportTest thrift)
144LINK_AGAINST_THRIFT_LIBRARY(TransportTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100145add_test(NAME TransportTest COMMAND TransportTest)
146
147add_executable(ZlibTest ZlibTest.cpp)
148target_link_libraries(ZlibTest
149 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100150 ${Boost_LIBRARIES}
151 ${ZLIB_LIBRARIES}
152)
Jim King9de9b1f2015-04-30 16:03:34 -0400153LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thrift)
154LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100155add_test(NAME ZlibTest COMMAND ZlibTest)
156endif(WITH_ZLIB)
157
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500158add_executable(AnnotationTest AnnotationTest.cpp)
159target_link_libraries(AnnotationTest
160 testgencpp
161 ${Boost_LIBRARIES}
162)
163LINK_AGAINST_THRIFT_LIBRARY(AnnotationTest thrift)
164add_test(NAME AnnotationTest COMMAND AnnotationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100165
166add_executable(EnumTest EnumTest.cpp)
167target_link_libraries(EnumTest
168 testgencpp
169 ${Boost_LIBRARIES}
170)
Jim King9de9b1f2015-04-30 16:03:34 -0400171LINK_AGAINST_THRIFT_LIBRARY(EnumTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100172add_test(NAME EnumTest COMMAND EnumTest)
173
Jim King9de9b1f2015-04-30 16:03:34 -0400174if(HAVE_GETOPT_H)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100175add_executable(TFileTransportTest TFileTransportTest.cpp)
176target_link_libraries(TFileTransportTest
177 testgencpp
178 ${Boost_LIBRARIES}
179)
Jim King9de9b1f2015-04-30 16:03:34 -0400180LINK_AGAINST_THRIFT_LIBRARY(TFileTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100181add_test(NAME TFileTransportTest COMMAND TFileTransportTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400182endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100183
184add_executable(TFDTransportTest TFDTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200185target_link_libraries(TFDTransportTest
186 ${Boost_LIBRARIES}
187)
Jim King9de9b1f2015-04-30 16:03:34 -0400188LINK_AGAINST_THRIFT_LIBRARY(TFDTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100189add_test(NAME TFDTransportTest COMMAND TFDTransportTest)
190
191add_executable(TPipedTransportTest TPipedTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200192target_link_libraries(TPipedTransportTest
193 ${Boost_LIBRARIES}
194)
Jim King9de9b1f2015-04-30 16:03:34 -0400195LINK_AGAINST_THRIFT_LIBRARY(TPipedTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100196add_test(NAME TPipedTransportTest COMMAND TPipedTransportTest)
197
198set(AllProtocolsTest_SOURCES
199 AllProtocolTests.cpp
200 AllProtocolTests.tcc
201 GenericHelpers
202 )
203
204add_executable(AllProtocolsTest ${AllProtocolsTest_SOURCES})
Claudius Heine5ef662b2015-06-24 10:03:50 +0200205target_link_libraries(AllProtocolsTest
206 testgencpp
207 ${Boost_LIBRARIES}
208)
Jim King9de9b1f2015-04-30 16:03:34 -0400209LINK_AGAINST_THRIFT_LIBRARY(AllProtocolsTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100210add_test(NAME AllProtocolsTest COMMAND AllProtocolsTest)
211
Jim King9de9b1f2015-04-30 16:03:34 -0400212# The debug run-time in Windows asserts on isprint() with negative inputs
213if (NOT MSVC OR (MSVC AND CMAKE_BUILD_TYPE EQUAL "DEBUG"))
Pascal Bachd5f87e12014-12-12 15:59:17 +0100214add_executable(DebugProtoTest DebugProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200215target_link_libraries(DebugProtoTest
216 testgencpp
217 ${Boost_LIBRARIES}
218)
Jim King9de9b1f2015-04-30 16:03:34 -0400219LINK_AGAINST_THRIFT_LIBRARY(DebugProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100220add_test(NAME DebugProtoTest COMMAND DebugProtoTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400221endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100222
223add_executable(JSONProtoTest JSONProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200224target_link_libraries(JSONProtoTest
225 testgencpp
226 ${Boost_LIBRARIES}
227)
Jim King9de9b1f2015-04-30 16:03:34 -0400228LINK_AGAINST_THRIFT_LIBRARY(JSONProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100229add_test(NAME JSONProtoTest COMMAND JSONProtoTest)
230
231add_executable(OptionalRequiredTest OptionalRequiredTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200232target_link_libraries(OptionalRequiredTest
233 testgencpp
234 ${Boost_LIBRARIES}
235)
Jim King9de9b1f2015-04-30 16:03:34 -0400236LINK_AGAINST_THRIFT_LIBRARY(OptionalRequiredTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100237add_test(NAME OptionalRequiredTest COMMAND OptionalRequiredTest)
238
239add_executable(RecursiveTest RecursiveTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200240target_link_libraries(RecursiveTest
241 testgencpp
242 ${Boost_LIBRARIES}
243)
Jim King9de9b1f2015-04-30 16:03:34 -0400244LINK_AGAINST_THRIFT_LIBRARY(RecursiveTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100245add_test(NAME RecursiveTest COMMAND RecursiveTest)
246
247add_executable(SpecializationTest SpecializationTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200248target_link_libraries(SpecializationTest
249 testgencpp
250 ${Boost_LIBRARIES}
251)
Jim King9de9b1f2015-04-30 16:03:34 -0400252LINK_AGAINST_THRIFT_LIBRARY(SpecializationTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100253add_test(NAME SpecializationTest COMMAND SpecializationTest)
254
255set(concurrency_test_SOURCES
256 concurrency/Tests.cpp
257 concurrency/ThreadFactoryTests.h
258 concurrency/ThreadManagerTests.h
259 concurrency/TimerManagerTests.h
260)
261add_executable(concurrency_test ${concurrency_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400262LINK_AGAINST_THRIFT_LIBRARY(concurrency_test thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100263add_test(NAME concurrency_test COMMAND concurrency_test)
264
265set(link_test_SOURCES
266 link/LinkTest.cpp
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900267 gen-cpp/ParentService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +0100268 link/TemplatedService1.cpp
269 link/TemplatedService2.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100270)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900271
Pascal Bachd5f87e12014-12-12 15:59:17 +0100272add_executable(link_test ${link_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400273target_link_libraries(link_test testgencpp_cob)
274LINK_AGAINST_THRIFT_LIBRARY(link_test thrift)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +0900275target_link_libraries(link_test testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100276add_test(NAME link_test COMMAND link_test)
277
278if(WITH_LIBEVENT)
279set(processor_test_SOURCES
280 processor/ProcessorTest.cpp
281 processor/EventLog.cpp
282 processor/ServerThread.cpp
283 processor/EventLog.h
284 processor/Handlers.h
285 processor/ServerThread.h
286)
287add_executable(processor_test ${processor_test_SOURCES})
288target_link_libraries(processor_test
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900289 testgencpp_cob
Pascal Bachd5f87e12014-12-12 15:59:17 +0100290 ${Boost_LIBRARIES}
291)
Jim King9de9b1f2015-04-30 16:03:34 -0400292LINK_AGAINST_THRIFT_LIBRARY(processor_test thrift)
293LINK_AGAINST_THRIFT_LIBRARY(processor_test thriftnb)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100294add_test(NAME processor_test COMMAND processor_test)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900295
296set(TNonblockingServerTest_SOURCES TNonblockingServerTest.cpp)
297add_executable(TNonblockingServerTest ${TNonblockingServerTest_SOURCES})
298include_directories(${LIBEVENT_INCLUDE_DIRS})
299target_link_libraries(TNonblockingServerTest
300 testgencpp_cob
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900301 ${LIBEVENT_LIBRARIES}
302 ${Boost_LIBRARIES}
303)
Jim King9de9b1f2015-04-30 16:03:34 -0400304LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thrift)
305LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thriftnb)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900306add_test(NAME TNonblockingServerTest COMMAND TNonblockingServerTest)
James E. King, III82ae9572017-08-05 12:23:54 -0400307
308if(OPENSSL_FOUND AND WITH_OPENSSL)
309 set(TNonblockingSSLServerTest_SOURCES TNonblockingSSLServerTest.cpp)
310 add_executable(TNonblockingSSLServerTest ${TNonblockingSSLServerTest_SOURCES})
311 include_directories(${LIBEVENT_INCLUDE_DIRS})
312 target_link_libraries(TNonblockingSSLServerTest
313 testgencpp_cob
314 ${LIBEVENT_LIBRARIES}
315 ${Boost_LIBRARIES}
316 )
317 LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thrift)
318 LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thriftnb)
319 add_test(NAME TNonblockingSSLServerTest COMMAND TNonblockingSSLServerTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
320endif(OPENSSL_FOUND AND WITH_OPENSSL)
321endif(WITH_LIBEVENT)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100322
323if(OPENSSL_FOUND AND WITH_OPENSSL)
324add_executable(OpenSSLManualInitTest OpenSSLManualInitTest.cpp)
325target_link_libraries(OpenSSLManualInitTest
Pascal Bachd5f87e12014-12-12 15:59:17 +0100326 ${OPENSSL_LIBRARIES}
327 ${Boost_LIBRARIES}
328)
Jim King9de9b1f2015-04-30 16:03:34 -0400329LINK_AGAINST_THRIFT_LIBRARY(OpenSSLManualInitTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100330add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300331
332add_executable(SecurityTest SecurityTest.cpp)
333target_link_libraries(SecurityTest
334 testgencpp
335 ${Boost_LIBRARIES}
336)
337LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100338if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300339target_link_libraries(SecurityTest -lrt)
340endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500341add_test(NAME SecurityTest COMMAND SecurityTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300342
Pascal Bachd5f87e12014-12-12 15:59:17 +0100343endif()
344
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900345if(WITH_QT4)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900346set(CMAKE_AUTOMOC ON)
347find_package(Qt4 REQUIRED COMPONENTS QtTest)
348set(TQTcpServerTest_SOURCES
349 qt/TQTcpServerTest.cpp
350)
351add_executable(TQTcpServerTest ${TQTcpServerTest_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400352target_link_libraries(TQTcpServerTest testgencpp_cob thriftqt Qt4::QtTest)
353LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest thrift)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900354add_test(NAME TQTcpServerTest COMMAND TQTcpServerTest)
355endif()
356
Nobuaki Sukegawa66228772014-12-07 21:45:33 +0900357if(WITH_QT5)
358add_subdirectory(qt)
359endif()
360
Pascal Bachd5f87e12014-12-12 15:59:17 +0100361#
362# Common thrift code generation rules
363#
364
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500365add_custom_command(OUTPUT gen-cpp/AnnotationTest_constants.cpp
366 gen-cpp/AnnotationTest_constants.h
367 gen-cpp/AnnotationTest_types.cpp
368 gen-cpp/AnnotationTest_types.h
369 gen-cpp/foo_service.cpp
370 gen-cpp/foo_service.h
371 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/AnnotationTest.thrift
372)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100373
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500374add_custom_command(OUTPUT gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h gen-cpp/EmptyService.cpp gen-cpp/EmptyService.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900375 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100376)
377
378add_custom_command(OUTPUT gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900379 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/EnumTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100380)
381
382add_custom_command(OUTPUT gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900383 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/TypedefTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100384)
385
386add_custom_command(OUTPUT gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900387 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100388)
389
390add_custom_command(OUTPUT gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900391 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/Recursive.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100392)
393
394add_custom_command(OUTPUT gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900395 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100396)
397
398add_custom_command(OUTPUT gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900399 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100400)
401
Chet Murthyad08a8b2017-12-19 15:55:56 -0800402add_custom_command(OUTPUT gen-cpp/OneWayService.cpp gen-cpp/OneWayTest_constants.cpp gen-cpp/OneWayTest_types.h gen-cpp/OneWayService.h gen-cpp/OneWayTest_constants.h gen-cpp/OneWayTest_types.cpp
403 COMMAND ${THRIFT_COMPILER} --gen cpp ${CMAKE_CURRENT_SOURCE_DIR}/OneWayTest.thrift
404)
405
Pascal Bachd5f87e12014-12-12 15:59:17 +0100406add_custom_command(OUTPUT gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900407 COMMAND ${THRIFT_COMPILER} --gen cpp:templates,cob_style ${CMAKE_CURRENT_SOURCE_DIR}/processor/proc.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100408)