blob: 5c5ed180a69b3ec38528bb1844e43828266bf93f [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
46 gen-cpp/TypedefTest_types.cpp
47 gen-cpp/TypedefTest_types.h
48 ThriftTest_extras.cpp
49 DebugProtoTest_extras.cpp
50)
51
52add_library(testgencpp STATIC ${testgencpp_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010053
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090054set(testgencpp_cob_SOURCES
Pascal Bachd5f87e12014-12-12 15:59:17 +010055 gen-cpp/ChildService.cpp
56 gen-cpp/ChildService.h
Ben Craig1684c422015-04-24 08:52:44 -050057 gen-cpp/EmptyService.cpp
58 gen-cpp/EmptyService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010059 gen-cpp/ParentService.cpp
60 gen-cpp/ParentService.h
61 gen-cpp/proc_types.cpp
62 gen-cpp/proc_types.h
63)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090064add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010065
Pascal Bachd5f87e12014-12-12 15:59:17 +010066add_executable(Benchmark Benchmark.cpp)
67target_link_libraries(Benchmark testgencpp)
Jim King9de9b1f2015-04-30 16:03:34 -040068LINK_AGAINST_THRIFT_LIBRARY(Benchmark thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010069add_test(NAME Benchmark COMMAND Benchmark)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090070target_link_libraries(Benchmark testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +010071
72set(UnitTest_SOURCES
73 UnitTestMain.cpp
74 TMemoryBufferTest.cpp
75 TBufferBaseTest.cpp
76 Base64Test.cpp
77 ToStringTest.cpp
78 TypedefTest.cpp
Roger Meier3815e0b2015-04-04 16:26:30 +020079 TServerSocketTest.cpp
Ben Craig1684c422015-04-24 08:52:44 -050080 TServerTransportTest.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +010081)
82
James E. King, III07f59972017-03-10 06:18:33 -050083if(NOT WITH_BOOSTTHREADS AND NOT WITH_STDTHREADS AND NOT MSVC AND NOT MINGW)
James E. King, III00d42522017-04-04 09:32:45 -040084 list(APPEND UnitTest_SOURCES concurrency/MutexTest.cpp)
85 list(APPEND UnitTest_SOURCES concurrency/RWMutexStarveTest.cpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +010086endif()
87
88add_executable(UnitTests ${UnitTest_SOURCES})
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090089target_link_libraries(UnitTests testgencpp ${Boost_LIBRARIES})
Jim King9de9b1f2015-04-30 16:03:34 -040090LINK_AGAINST_THRIFT_LIBRARY(UnitTests thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010091add_test(NAME UnitTests COMMAND UnitTests)
ben-craigfae08e72015-07-15 11:34:47 -050092if ( MSVC )
93 # Disable C4503: decorated name length exceeded, name was truncated
94 # 'insanity' results in very long decorated names
95 set_property( TARGET UnitTests APPEND_STRING PROPERTY COMPILE_FLAGS /wd4503 )
96endif ( MSVC )
Pascal Bachd5f87e12014-12-12 15:59:17 +010097
ben-craigaf2d9c82015-07-16 08:11:21 -050098
Martin Haimberger0ad6ee92015-11-13 03:18:50 -080099set( TInterruptTest_SOURCES
100 TSocketInterruptTest.cpp
101 TSSLSocketInterruptTest.cpp
102)
ben-craigaf2d9c82015-07-16 08:11:21 -0500103if (WIN32)
104 list(APPEND TInterruptTest_SOURCES
105 TPipeInterruptTest.cpp
106 )
107endif()
108add_executable(TInterruptTest ${TInterruptTest_SOURCES})
109target_link_libraries(TInterruptTest
Ben Craig1684c422015-04-24 08:52:44 -0500110 testgencpp
111 ${Boost_LIBRARIES}
Ben Craig1684c422015-04-24 08:52:44 -0500112)
ben-craigaf2d9c82015-07-16 08:11:21 -0500113LINK_AGAINST_THRIFT_LIBRARY(TInterruptTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100114if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
ben-craigaf2d9c82015-07-16 08:11:21 -0500115target_link_libraries(TInterruptTest -lrt)
Ben Craig1684c422015-04-24 08:52:44 -0500116endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500117add_test(NAME TInterruptTest COMMAND TInterruptTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Ben Craig1684c422015-04-24 08:52:44 -0500118
119add_executable(TServerIntegrationTest TServerIntegrationTest.cpp)
120target_link_libraries(TServerIntegrationTest
121 testgencpp_cob
122 ${Boost_LIBRARIES}
123)
Jim King9de9b1f2015-04-30 16:03:34 -0400124LINK_AGAINST_THRIFT_LIBRARY(TServerIntegrationTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100125if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Ben Craig1684c422015-04-24 08:52:44 -0500126target_link_libraries(TServerIntegrationTest -lrt)
127endif ()
128add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100129
130if(WITH_ZLIB)
Nobuaki Sukegawa3e5b9c22016-02-22 21:47:23 +0900131include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
Pascal Bachd5f87e12014-12-12 15:59:17 +0100132add_executable(TransportTest TransportTest.cpp)
133target_link_libraries(TransportTest
134 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100135 ${Boost_LIBRARIES}
136 ${ZLIB_LIBRARIES}
137)
Jim King9de9b1f2015-04-30 16:03:34 -0400138LINK_AGAINST_THRIFT_LIBRARY(TransportTest thrift)
139LINK_AGAINST_THRIFT_LIBRARY(TransportTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100140add_test(NAME TransportTest COMMAND TransportTest)
141
142add_executable(ZlibTest ZlibTest.cpp)
143target_link_libraries(ZlibTest
144 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100145 ${Boost_LIBRARIES}
146 ${ZLIB_LIBRARIES}
147)
Jim King9de9b1f2015-04-30 16:03:34 -0400148LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thrift)
149LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100150add_test(NAME ZlibTest COMMAND ZlibTest)
151endif(WITH_ZLIB)
152
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500153add_executable(AnnotationTest AnnotationTest.cpp)
154target_link_libraries(AnnotationTest
155 testgencpp
156 ${Boost_LIBRARIES}
157)
158LINK_AGAINST_THRIFT_LIBRARY(AnnotationTest thrift)
159add_test(NAME AnnotationTest COMMAND AnnotationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100160
161add_executable(EnumTest EnumTest.cpp)
162target_link_libraries(EnumTest
163 testgencpp
164 ${Boost_LIBRARIES}
165)
Jim King9de9b1f2015-04-30 16:03:34 -0400166LINK_AGAINST_THRIFT_LIBRARY(EnumTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100167add_test(NAME EnumTest COMMAND EnumTest)
168
Jim King9de9b1f2015-04-30 16:03:34 -0400169if(HAVE_GETOPT_H)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100170add_executable(TFileTransportTest TFileTransportTest.cpp)
171target_link_libraries(TFileTransportTest
172 testgencpp
173 ${Boost_LIBRARIES}
174)
Jim King9de9b1f2015-04-30 16:03:34 -0400175LINK_AGAINST_THRIFT_LIBRARY(TFileTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100176add_test(NAME TFileTransportTest COMMAND TFileTransportTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400177endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100178
179add_executable(TFDTransportTest TFDTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200180target_link_libraries(TFDTransportTest
181 ${Boost_LIBRARIES}
182)
Jim King9de9b1f2015-04-30 16:03:34 -0400183LINK_AGAINST_THRIFT_LIBRARY(TFDTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100184add_test(NAME TFDTransportTest COMMAND TFDTransportTest)
185
186add_executable(TPipedTransportTest TPipedTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200187target_link_libraries(TPipedTransportTest
188 ${Boost_LIBRARIES}
189)
Jim King9de9b1f2015-04-30 16:03:34 -0400190LINK_AGAINST_THRIFT_LIBRARY(TPipedTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100191add_test(NAME TPipedTransportTest COMMAND TPipedTransportTest)
192
193set(AllProtocolsTest_SOURCES
194 AllProtocolTests.cpp
195 AllProtocolTests.tcc
196 GenericHelpers
197 )
198
199add_executable(AllProtocolsTest ${AllProtocolsTest_SOURCES})
Claudius Heine5ef662b2015-06-24 10:03:50 +0200200target_link_libraries(AllProtocolsTest
201 testgencpp
202 ${Boost_LIBRARIES}
203)
Jim King9de9b1f2015-04-30 16:03:34 -0400204LINK_AGAINST_THRIFT_LIBRARY(AllProtocolsTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100205add_test(NAME AllProtocolsTest COMMAND AllProtocolsTest)
206
Jim King9de9b1f2015-04-30 16:03:34 -0400207# The debug run-time in Windows asserts on isprint() with negative inputs
208if (NOT MSVC OR (MSVC AND CMAKE_BUILD_TYPE EQUAL "DEBUG"))
Pascal Bachd5f87e12014-12-12 15:59:17 +0100209add_executable(DebugProtoTest DebugProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200210target_link_libraries(DebugProtoTest
211 testgencpp
212 ${Boost_LIBRARIES}
213)
Jim King9de9b1f2015-04-30 16:03:34 -0400214LINK_AGAINST_THRIFT_LIBRARY(DebugProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100215add_test(NAME DebugProtoTest COMMAND DebugProtoTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400216endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100217
218add_executable(JSONProtoTest JSONProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200219target_link_libraries(JSONProtoTest
220 testgencpp
221 ${Boost_LIBRARIES}
222)
Jim King9de9b1f2015-04-30 16:03:34 -0400223LINK_AGAINST_THRIFT_LIBRARY(JSONProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100224add_test(NAME JSONProtoTest COMMAND JSONProtoTest)
225
226add_executable(OptionalRequiredTest OptionalRequiredTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200227target_link_libraries(OptionalRequiredTest
228 testgencpp
229 ${Boost_LIBRARIES}
230)
Jim King9de9b1f2015-04-30 16:03:34 -0400231LINK_AGAINST_THRIFT_LIBRARY(OptionalRequiredTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100232add_test(NAME OptionalRequiredTest COMMAND OptionalRequiredTest)
233
234add_executable(RecursiveTest RecursiveTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200235target_link_libraries(RecursiveTest
236 testgencpp
237 ${Boost_LIBRARIES}
238)
Jim King9de9b1f2015-04-30 16:03:34 -0400239LINK_AGAINST_THRIFT_LIBRARY(RecursiveTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100240add_test(NAME RecursiveTest COMMAND RecursiveTest)
241
242add_executable(SpecializationTest SpecializationTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200243target_link_libraries(SpecializationTest
244 testgencpp
245 ${Boost_LIBRARIES}
246)
Jim King9de9b1f2015-04-30 16:03:34 -0400247LINK_AGAINST_THRIFT_LIBRARY(SpecializationTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100248add_test(NAME SpecializationTest COMMAND SpecializationTest)
249
250set(concurrency_test_SOURCES
251 concurrency/Tests.cpp
252 concurrency/ThreadFactoryTests.h
253 concurrency/ThreadManagerTests.h
254 concurrency/TimerManagerTests.h
255)
256add_executable(concurrency_test ${concurrency_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400257LINK_AGAINST_THRIFT_LIBRARY(concurrency_test thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100258add_test(NAME concurrency_test COMMAND concurrency_test)
259
260set(link_test_SOURCES
261 link/LinkTest.cpp
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900262 gen-cpp/ParentService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +0100263 link/TemplatedService1.cpp
264 link/TemplatedService2.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100265)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900266
Pascal Bachd5f87e12014-12-12 15:59:17 +0100267add_executable(link_test ${link_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400268target_link_libraries(link_test testgencpp_cob)
269LINK_AGAINST_THRIFT_LIBRARY(link_test thrift)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +0900270target_link_libraries(link_test testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100271add_test(NAME link_test COMMAND link_test)
272
273if(WITH_LIBEVENT)
274set(processor_test_SOURCES
275 processor/ProcessorTest.cpp
276 processor/EventLog.cpp
277 processor/ServerThread.cpp
278 processor/EventLog.h
279 processor/Handlers.h
280 processor/ServerThread.h
281)
282add_executable(processor_test ${processor_test_SOURCES})
283target_link_libraries(processor_test
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900284 testgencpp_cob
Pascal Bachd5f87e12014-12-12 15:59:17 +0100285 ${Boost_LIBRARIES}
286)
Jim King9de9b1f2015-04-30 16:03:34 -0400287LINK_AGAINST_THRIFT_LIBRARY(processor_test thrift)
288LINK_AGAINST_THRIFT_LIBRARY(processor_test thriftnb)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100289add_test(NAME processor_test COMMAND processor_test)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900290
291set(TNonblockingServerTest_SOURCES TNonblockingServerTest.cpp)
292add_executable(TNonblockingServerTest ${TNonblockingServerTest_SOURCES})
293include_directories(${LIBEVENT_INCLUDE_DIRS})
294target_link_libraries(TNonblockingServerTest
295 testgencpp_cob
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900296 ${LIBEVENT_LIBRARIES}
297 ${Boost_LIBRARIES}
298)
Jim King9de9b1f2015-04-30 16:03:34 -0400299LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thrift)
300LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thriftnb)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900301add_test(NAME TNonblockingServerTest COMMAND TNonblockingServerTest)
James E. King, III82ae9572017-08-05 12:23:54 -0400302
303if(OPENSSL_FOUND AND WITH_OPENSSL)
304 set(TNonblockingSSLServerTest_SOURCES TNonblockingSSLServerTest.cpp)
305 add_executable(TNonblockingSSLServerTest ${TNonblockingSSLServerTest_SOURCES})
306 include_directories(${LIBEVENT_INCLUDE_DIRS})
307 target_link_libraries(TNonblockingSSLServerTest
308 testgencpp_cob
309 ${LIBEVENT_LIBRARIES}
310 ${Boost_LIBRARIES}
311 )
312 LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thrift)
313 LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thriftnb)
314 add_test(NAME TNonblockingSSLServerTest COMMAND TNonblockingSSLServerTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
315endif(OPENSSL_FOUND AND WITH_OPENSSL)
316endif(WITH_LIBEVENT)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100317
318if(OPENSSL_FOUND AND WITH_OPENSSL)
319add_executable(OpenSSLManualInitTest OpenSSLManualInitTest.cpp)
320target_link_libraries(OpenSSLManualInitTest
Pascal Bachd5f87e12014-12-12 15:59:17 +0100321 ${OPENSSL_LIBRARIES}
322 ${Boost_LIBRARIES}
323)
Jim King9de9b1f2015-04-30 16:03:34 -0400324LINK_AGAINST_THRIFT_LIBRARY(OpenSSLManualInitTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100325add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300326
327add_executable(SecurityTest SecurityTest.cpp)
328target_link_libraries(SecurityTest
329 testgencpp
330 ${Boost_LIBRARIES}
331)
332LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100333if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300334target_link_libraries(SecurityTest -lrt)
335endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500336add_test(NAME SecurityTest COMMAND SecurityTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300337
Pascal Bachd5f87e12014-12-12 15:59:17 +0100338endif()
339
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900340if(WITH_QT4)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900341set(CMAKE_AUTOMOC ON)
342find_package(Qt4 REQUIRED COMPONENTS QtTest)
343set(TQTcpServerTest_SOURCES
344 qt/TQTcpServerTest.cpp
345)
346add_executable(TQTcpServerTest ${TQTcpServerTest_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400347target_link_libraries(TQTcpServerTest testgencpp_cob thriftqt Qt4::QtTest)
348LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest thrift)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900349add_test(NAME TQTcpServerTest COMMAND TQTcpServerTest)
350endif()
351
Nobuaki Sukegawa66228772014-12-07 21:45:33 +0900352if(WITH_QT5)
353add_subdirectory(qt)
354endif()
355
Pascal Bachd5f87e12014-12-12 15:59:17 +0100356#
357# Common thrift code generation rules
358#
359
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500360add_custom_command(OUTPUT gen-cpp/AnnotationTest_constants.cpp
361 gen-cpp/AnnotationTest_constants.h
362 gen-cpp/AnnotationTest_types.cpp
363 gen-cpp/AnnotationTest_types.h
364 gen-cpp/foo_service.cpp
365 gen-cpp/foo_service.h
366 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/AnnotationTest.thrift
367)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100368
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500369add_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 +0900370 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100371)
372
373add_custom_command(OUTPUT gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900374 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/EnumTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100375)
376
377add_custom_command(OUTPUT gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900378 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/TypedefTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100379)
380
381add_custom_command(OUTPUT gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900382 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100383)
384
385add_custom_command(OUTPUT gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900386 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/Recursive.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100387)
388
389add_custom_command(OUTPUT gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900390 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100391)
392
393add_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 +0900394 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100395)
396
397add_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 +0900398 COMMAND ${THRIFT_COMPILER} --gen cpp:templates,cob_style ${CMAKE_CURRENT_SOURCE_DIR}/processor/proc.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100399)