blob: a0b94d6ecc5bb0878941b76e3618611489e6f411 [file] [log] [blame]
Roger Meiera03464c2015-09-30 08:15:53 +02001macro(GENERATE FILENAME GENERATOR OUTPUTDIR)
2 file(MAKE_DIRECTORY ${MY_CURRENT_SOURCE_DIR}/${OUTPUTDIR})
3 execute_process(COMMAND ${THRIFTCOMPILER} --gen ${GENERATOR} -out ${OUTPUTDIR} ${FILENAME}
4 WORKING_DIRECTORY ${MY_CURRENT_SOURCE_DIR}
5 RESULT_VARIABLE CMD_RESULT)
6 if(CMD_RESULT)
7 message(FATAL_ERROR "Error generating ${FILENAME} with generator ${GENERATOR}")
8 endif()
9endmacro(GENERATE)
10
11generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py gen-py-default)
12generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:slots gen-py-slots)
13generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:new_style gen-py-newstyle)
14generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:new_style,slots gen-py-newstyleslots)
15generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic gen-py-dynamic)
16generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic,slots gen-py-dynamicslots)
17
18generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py gen-py-default)
19generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:slots gen-py-slots)
20generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:new_style gen-py-newstyle)
21generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:new_style,slots gen-py-newstyleslots)
22generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic gen-py-dynamic)
23generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic,slots gen-py-dynamicslots)
24