Roger Meier | a03464c | 2015-09-30 08:15:53 +0200 | [diff] [blame] | 1 | macro(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() |
| 9 | endmacro(GENERATE) |
| 10 | |
| 11 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py gen-py-default) |
| 12 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:slots gen-py-slots) |
| 13 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:new_style gen-py-newstyle) |
| 14 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:new_style,slots gen-py-newstyleslots) |
| 15 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic gen-py-dynamic) |
| 16 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic,slots gen-py-dynamicslots) |
| 17 | |
| 18 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py gen-py-default) |
| 19 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:slots gen-py-slots) |
| 20 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:new_style gen-py-newstyle) |
| 21 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:new_style,slots gen-py-newstyleslots) |
| 22 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic gen-py-dynamic) |
| 23 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic,slots gen-py-dynamicslots) |
| 24 | |