blob: ef3d417a39688a526cd48f22696a0a82ee6828fa [file] [log] [blame]
Pascal Bachd5f87e12014-12-12 15:59:17 +01001#
2# 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, III7edc8fa2017-01-20 10:11:41 -050022add_definitions("-D__STDC_LIMIT_MACROS")
23
24if (WITH_DYN_LINK_TEST)
25 add_definitions( -DBOOST_TEST_DYN_LINK )
26endif()
27
28# Make sure gen-cpp files can be included
Pascal Bachd5f87e12014-12-12 15:59:17 +010029include_directories("${CMAKE_CURRENT_BINARY_DIR}")
30
31# Create the thrift C++ test library
32set(testgencpp_SOURCES
James E. King, IIIb4c190b2017-02-13 16:39:59 -050033 gen-cpp/AnnotationTest_types.cpp
34 gen-cpp/AnnotationTest_types.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010035 gen-cpp/DebugProtoTest_types.cpp
36 gen-cpp/DebugProtoTest_types.h
37 gen-cpp/EnumTest_types.cpp
38 gen-cpp/EnumTest_types.h
39 gen-cpp/OptionalRequiredTest_types.cpp
40 gen-cpp/OptionalRequiredTest_types.h
41 gen-cpp/Recursive_types.cpp
42 gen-cpp/Recursive_types.h
43 gen-cpp/ThriftTest_types.cpp
44 gen-cpp/ThriftTest_types.h
45 gen-cpp/TypedefTest_types.cpp
46 gen-cpp/TypedefTest_types.h
47 ThriftTest_extras.cpp
48 DebugProtoTest_extras.cpp
49)
50
51add_library(testgencpp STATIC ${testgencpp_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010052
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090053set(testgencpp_cob_SOURCES
Pascal Bachd5f87e12014-12-12 15:59:17 +010054 gen-cpp/ChildService.cpp
55 gen-cpp/ChildService.h
Ben Craig1684c422015-04-24 08:52:44 -050056 gen-cpp/EmptyService.cpp
57 gen-cpp/EmptyService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +010058 gen-cpp/ParentService.cpp
59 gen-cpp/ParentService.h
60 gen-cpp/proc_types.cpp
61 gen-cpp/proc_types.h
62)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +090063add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES})
Pascal Bachd5f87e12014-12-12 15:59:17 +010064
Pascal Bachd5f87e12014-12-12 15:59:17 +010065add_executable(Benchmark Benchmark.cpp)
66target_link_libraries(Benchmark testgencpp)
Jim King9de9b1f2015-04-30 16:03:34 -040067LINK_AGAINST_THRIFT_LIBRARY(Benchmark thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010068add_test(NAME Benchmark COMMAND Benchmark)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090069target_link_libraries(Benchmark testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +010070
71set(UnitTest_SOURCES
72 UnitTestMain.cpp
73 TMemoryBufferTest.cpp
74 TBufferBaseTest.cpp
75 Base64Test.cpp
76 ToStringTest.cpp
77 TypedefTest.cpp
Roger Meier3815e0b2015-04-04 16:26:30 +020078 TServerSocketTest.cpp
Ben Craig1684c422015-04-24 08:52:44 -050079 TServerTransportTest.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +010080)
81
James E. King, III07f59972017-03-10 06:18:33 -050082if(NOT WITH_BOOSTTHREADS AND NOT WITH_STDTHREADS AND NOT MSVC AND NOT MINGW)
Pascal Bachd5f87e12014-12-12 15:59:17 +010083 list(APPEND UnitTest_SOURCES RWMutexStarveTest.cpp)
84endif()
85
86add_executable(UnitTests ${UnitTest_SOURCES})
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +090087target_link_libraries(UnitTests testgencpp ${Boost_LIBRARIES})
Jim King9de9b1f2015-04-30 16:03:34 -040088LINK_AGAINST_THRIFT_LIBRARY(UnitTests thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +010089add_test(NAME UnitTests COMMAND UnitTests)
ben-craigfae08e72015-07-15 11:34:47 -050090if ( MSVC )
91 # Disable C4503: decorated name length exceeded, name was truncated
92 # 'insanity' results in very long decorated names
93 set_property( TARGET UnitTests APPEND_STRING PROPERTY COMPILE_FLAGS /wd4503 )
94endif ( MSVC )
Pascal Bachd5f87e12014-12-12 15:59:17 +010095
ben-craigaf2d9c82015-07-16 08:11:21 -050096
Martin Haimberger0ad6ee92015-11-13 03:18:50 -080097set( TInterruptTest_SOURCES
98 TSocketInterruptTest.cpp
99 TSSLSocketInterruptTest.cpp
100)
ben-craigaf2d9c82015-07-16 08:11:21 -0500101if (WIN32)
102 list(APPEND TInterruptTest_SOURCES
103 TPipeInterruptTest.cpp
104 )
105endif()
106add_executable(TInterruptTest ${TInterruptTest_SOURCES})
107target_link_libraries(TInterruptTest
Ben Craig1684c422015-04-24 08:52:44 -0500108 testgencpp
109 ${Boost_LIBRARIES}
Ben Craig1684c422015-04-24 08:52:44 -0500110)
ben-craigaf2d9c82015-07-16 08:11:21 -0500111LINK_AGAINST_THRIFT_LIBRARY(TInterruptTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100112if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
ben-craigaf2d9c82015-07-16 08:11:21 -0500113target_link_libraries(TInterruptTest -lrt)
Ben Craig1684c422015-04-24 08:52:44 -0500114endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500115add_test(NAME TInterruptTest COMMAND TInterruptTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Ben Craig1684c422015-04-24 08:52:44 -0500116
117add_executable(TServerIntegrationTest TServerIntegrationTest.cpp)
118target_link_libraries(TServerIntegrationTest
119 testgencpp_cob
120 ${Boost_LIBRARIES}
121)
Jim King9de9b1f2015-04-30 16:03:34 -0400122LINK_AGAINST_THRIFT_LIBRARY(TServerIntegrationTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100123if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Ben Craig1684c422015-04-24 08:52:44 -0500124target_link_libraries(TServerIntegrationTest -lrt)
125endif ()
126add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100127
128if(WITH_ZLIB)
Nobuaki Sukegawa3e5b9c22016-02-22 21:47:23 +0900129include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
Pascal Bachd5f87e12014-12-12 15:59:17 +0100130add_executable(TransportTest TransportTest.cpp)
131target_link_libraries(TransportTest
132 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100133 ${Boost_LIBRARIES}
134 ${ZLIB_LIBRARIES}
135)
Jim King9de9b1f2015-04-30 16:03:34 -0400136LINK_AGAINST_THRIFT_LIBRARY(TransportTest thrift)
137LINK_AGAINST_THRIFT_LIBRARY(TransportTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100138add_test(NAME TransportTest COMMAND TransportTest)
139
140add_executable(ZlibTest ZlibTest.cpp)
141target_link_libraries(ZlibTest
142 testgencpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100143 ${Boost_LIBRARIES}
144 ${ZLIB_LIBRARIES}
145)
Jim King9de9b1f2015-04-30 16:03:34 -0400146LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thrift)
147LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thriftz)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100148add_test(NAME ZlibTest COMMAND ZlibTest)
149endif(WITH_ZLIB)
150
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500151add_executable(AnnotationTest AnnotationTest.cpp)
152target_link_libraries(AnnotationTest
153 testgencpp
154 ${Boost_LIBRARIES}
155)
156LINK_AGAINST_THRIFT_LIBRARY(AnnotationTest thrift)
157add_test(NAME AnnotationTest COMMAND AnnotationTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100158
159add_executable(EnumTest EnumTest.cpp)
160target_link_libraries(EnumTest
161 testgencpp
162 ${Boost_LIBRARIES}
163)
Jim King9de9b1f2015-04-30 16:03:34 -0400164LINK_AGAINST_THRIFT_LIBRARY(EnumTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100165add_test(NAME EnumTest COMMAND EnumTest)
166
Jim King9de9b1f2015-04-30 16:03:34 -0400167if(HAVE_GETOPT_H)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100168add_executable(TFileTransportTest TFileTransportTest.cpp)
169target_link_libraries(TFileTransportTest
170 testgencpp
171 ${Boost_LIBRARIES}
172)
Jim King9de9b1f2015-04-30 16:03:34 -0400173LINK_AGAINST_THRIFT_LIBRARY(TFileTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100174add_test(NAME TFileTransportTest COMMAND TFileTransportTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400175endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100176
177add_executable(TFDTransportTest TFDTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200178target_link_libraries(TFDTransportTest
179 ${Boost_LIBRARIES}
180)
Jim King9de9b1f2015-04-30 16:03:34 -0400181LINK_AGAINST_THRIFT_LIBRARY(TFDTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100182add_test(NAME TFDTransportTest COMMAND TFDTransportTest)
183
184add_executable(TPipedTransportTest TPipedTransportTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200185target_link_libraries(TPipedTransportTest
186 ${Boost_LIBRARIES}
187)
Jim King9de9b1f2015-04-30 16:03:34 -0400188LINK_AGAINST_THRIFT_LIBRARY(TPipedTransportTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100189add_test(NAME TPipedTransportTest COMMAND TPipedTransportTest)
190
191set(AllProtocolsTest_SOURCES
192 AllProtocolTests.cpp
193 AllProtocolTests.tcc
194 GenericHelpers
195 )
196
197add_executable(AllProtocolsTest ${AllProtocolsTest_SOURCES})
Claudius Heine5ef662b2015-06-24 10:03:50 +0200198target_link_libraries(AllProtocolsTest
199 testgencpp
200 ${Boost_LIBRARIES}
201)
Jim King9de9b1f2015-04-30 16:03:34 -0400202LINK_AGAINST_THRIFT_LIBRARY(AllProtocolsTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100203add_test(NAME AllProtocolsTest COMMAND AllProtocolsTest)
204
Jim King9de9b1f2015-04-30 16:03:34 -0400205# The debug run-time in Windows asserts on isprint() with negative inputs
206if (NOT MSVC OR (MSVC AND CMAKE_BUILD_TYPE EQUAL "DEBUG"))
Pascal Bachd5f87e12014-12-12 15:59:17 +0100207add_executable(DebugProtoTest DebugProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200208target_link_libraries(DebugProtoTest
209 testgencpp
210 ${Boost_LIBRARIES}
211)
Jim King9de9b1f2015-04-30 16:03:34 -0400212LINK_AGAINST_THRIFT_LIBRARY(DebugProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100213add_test(NAME DebugProtoTest COMMAND DebugProtoTest)
Jim King9de9b1f2015-04-30 16:03:34 -0400214endif()
Pascal Bachd5f87e12014-12-12 15:59:17 +0100215
216add_executable(JSONProtoTest JSONProtoTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200217target_link_libraries(JSONProtoTest
218 testgencpp
219 ${Boost_LIBRARIES}
220)
Jim King9de9b1f2015-04-30 16:03:34 -0400221LINK_AGAINST_THRIFT_LIBRARY(JSONProtoTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100222add_test(NAME JSONProtoTest COMMAND JSONProtoTest)
223
224add_executable(OptionalRequiredTest OptionalRequiredTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200225target_link_libraries(OptionalRequiredTest
226 testgencpp
227 ${Boost_LIBRARIES}
228)
Jim King9de9b1f2015-04-30 16:03:34 -0400229LINK_AGAINST_THRIFT_LIBRARY(OptionalRequiredTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100230add_test(NAME OptionalRequiredTest COMMAND OptionalRequiredTest)
231
232add_executable(RecursiveTest RecursiveTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200233target_link_libraries(RecursiveTest
234 testgencpp
235 ${Boost_LIBRARIES}
236)
Jim King9de9b1f2015-04-30 16:03:34 -0400237LINK_AGAINST_THRIFT_LIBRARY(RecursiveTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100238add_test(NAME RecursiveTest COMMAND RecursiveTest)
239
240add_executable(SpecializationTest SpecializationTest.cpp)
Claudius Heine5ef662b2015-06-24 10:03:50 +0200241target_link_libraries(SpecializationTest
242 testgencpp
243 ${Boost_LIBRARIES}
244)
Jim King9de9b1f2015-04-30 16:03:34 -0400245LINK_AGAINST_THRIFT_LIBRARY(SpecializationTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100246add_test(NAME SpecializationTest COMMAND SpecializationTest)
247
248set(concurrency_test_SOURCES
249 concurrency/Tests.cpp
250 concurrency/ThreadFactoryTests.h
251 concurrency/ThreadManagerTests.h
252 concurrency/TimerManagerTests.h
253)
254add_executable(concurrency_test ${concurrency_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400255LINK_AGAINST_THRIFT_LIBRARY(concurrency_test thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100256add_test(NAME concurrency_test COMMAND concurrency_test)
257
258set(link_test_SOURCES
259 link/LinkTest.cpp
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900260 gen-cpp/ParentService.h
Pascal Bachd5f87e12014-12-12 15:59:17 +0100261 link/TemplatedService1.cpp
262 link/TemplatedService2.cpp
Pascal Bachd5f87e12014-12-12 15:59:17 +0100263)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900264
Pascal Bachd5f87e12014-12-12 15:59:17 +0100265add_executable(link_test ${link_test_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400266target_link_libraries(link_test testgencpp_cob)
267LINK_AGAINST_THRIFT_LIBRARY(link_test thrift)
Nobuaki Sukegawae8c71d82015-11-23 19:51:37 +0900268target_link_libraries(link_test testgencpp)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100269add_test(NAME link_test COMMAND link_test)
270
271if(WITH_LIBEVENT)
272set(processor_test_SOURCES
273 processor/ProcessorTest.cpp
274 processor/EventLog.cpp
275 processor/ServerThread.cpp
276 processor/EventLog.h
277 processor/Handlers.h
278 processor/ServerThread.h
279)
280add_executable(processor_test ${processor_test_SOURCES})
281target_link_libraries(processor_test
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900282 testgencpp_cob
Pascal Bachd5f87e12014-12-12 15:59:17 +0100283 ${Boost_LIBRARIES}
284)
Jim King9de9b1f2015-04-30 16:03:34 -0400285LINK_AGAINST_THRIFT_LIBRARY(processor_test thrift)
286LINK_AGAINST_THRIFT_LIBRARY(processor_test thriftnb)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100287add_test(NAME processor_test COMMAND processor_test)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900288
289set(TNonblockingServerTest_SOURCES TNonblockingServerTest.cpp)
290add_executable(TNonblockingServerTest ${TNonblockingServerTest_SOURCES})
291include_directories(${LIBEVENT_INCLUDE_DIRS})
292target_link_libraries(TNonblockingServerTest
293 testgencpp_cob
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900294 ${LIBEVENT_LIBRARIES}
295 ${Boost_LIBRARIES}
296)
Jim King9de9b1f2015-04-30 16:03:34 -0400297LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thrift)
298LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thriftnb)
Nobuaki Sukegawa8016af82015-01-02 23:14:22 +0900299add_test(NAME TNonblockingServerTest COMMAND TNonblockingServerTest)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100300endif()
301
302if(OPENSSL_FOUND AND WITH_OPENSSL)
303add_executable(OpenSSLManualInitTest OpenSSLManualInitTest.cpp)
304target_link_libraries(OpenSSLManualInitTest
Pascal Bachd5f87e12014-12-12 15:59:17 +0100305 ${OPENSSL_LIBRARIES}
306 ${Boost_LIBRARIES}
307)
Jim King9de9b1f2015-04-30 16:03:34 -0400308LINK_AGAINST_THRIFT_LIBRARY(OpenSSLManualInitTest thrift)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100309add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300310
311add_executable(SecurityTest SecurityTest.cpp)
312target_link_libraries(SecurityTest
313 testgencpp
314 ${Boost_LIBRARIES}
315)
316LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift)
Antonio Di Monaco796667b2016-01-04 23:05:19 +0100317if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW)
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300318target_link_libraries(SecurityTest -lrt)
319endif ()
James E. King, III07f59972017-03-10 06:18:33 -0500320add_test(NAME SecurityTest COMMAND SecurityTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys")
Sergei Nikulov34e0bb62015-09-02 13:06:22 +0300321
Pascal Bachd5f87e12014-12-12 15:59:17 +0100322endif()
323
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900324if(WITH_QT4)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900325set(CMAKE_AUTOMOC ON)
326find_package(Qt4 REQUIRED COMPONENTS QtTest)
327set(TQTcpServerTest_SOURCES
328 qt/TQTcpServerTest.cpp
329)
330add_executable(TQTcpServerTest ${TQTcpServerTest_SOURCES})
Jim King9de9b1f2015-04-30 16:03:34 -0400331target_link_libraries(TQTcpServerTest testgencpp_cob thriftqt Qt4::QtTest)
332LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest thrift)
Nobuaki Sukegawa6304a532014-12-18 01:30:58 +0900333add_test(NAME TQTcpServerTest COMMAND TQTcpServerTest)
334endif()
335
Nobuaki Sukegawa66228772014-12-07 21:45:33 +0900336if(WITH_QT5)
337add_subdirectory(qt)
338endif()
339
Pascal Bachd5f87e12014-12-12 15:59:17 +0100340#
341# Common thrift code generation rules
342#
343
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500344add_custom_command(OUTPUT gen-cpp/AnnotationTest_constants.cpp
345 gen-cpp/AnnotationTest_constants.h
346 gen-cpp/AnnotationTest_types.cpp
347 gen-cpp/AnnotationTest_types.h
348 gen-cpp/foo_service.cpp
349 gen-cpp/foo_service.h
350 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/AnnotationTest.thrift
351)
Pascal Bachd5f87e12014-12-12 15:59:17 +0100352
James E. King, IIIb4c190b2017-02-13 16:39:59 -0500353add_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 +0900354 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100355)
356
357add_custom_command(OUTPUT gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900358 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/EnumTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100359)
360
361add_custom_command(OUTPUT gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900362 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/TypedefTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100363)
364
365add_custom_command(OUTPUT gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900366 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100367)
368
369add_custom_command(OUTPUT gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900370 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/Recursive.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100371)
372
373add_custom_command(OUTPUT gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
Nobuaki Sukegawaca939362015-11-14 00:23:40 +0900374 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100375)
376
377add_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 +0900378 COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100379)
380
381add_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 +0900382 COMMAND ${THRIFT_COMPILER} --gen cpp:templates,cob_style ${CMAKE_CURRENT_SOURCE_DIR}/processor/proc.thrift
Pascal Bachd5f87e12014-12-12 15:59:17 +0100383)