Roger Meier | a03464c | 2015-09-30 08:15:53 +0200 | [diff] [blame] | 1 | macro(GENERATE FILENAME GENERATOR OUTPUTDIR) |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 2 | file(MAKE_DIRECTORY ${MY_CURRENT_BINARY_DIR}/${OUTPUTDIR}) |
| 3 | execute_process(COMMAND ${THRIFTCOMPILER} --gen ${GENERATOR} -out ${MY_CURRENT_BINARY_DIR}/${OUTPUTDIR} ${FILENAME} |
Roger Meier | a03464c | 2015-09-30 08:15:53 +0200 | [diff] [blame] | 4 | RESULT_VARIABLE CMD_RESULT) |
| 5 | if(CMD_RESULT) |
| 6 | message(FATAL_ERROR "Error generating ${FILENAME} with generator ${GENERATOR}") |
| 7 | endif() |
| 8 | endmacro(GENERATE) |
| 9 | |
| 10 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py gen-py-default) |
| 11 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:slots gen-py-slots) |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 12 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:old_style gen-py-oldstyle) |
| 13 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:no_utf8strings gen-py-no_utf8strings) |
Roger Meier | a03464c | 2015-09-30 08:15:53 +0200 | [diff] [blame] | 14 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic gen-py-dynamic) |
| 15 | generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic,slots gen-py-dynamicslots) |
| 16 | |
| 17 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py gen-py-default) |
| 18 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:slots gen-py-slots) |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 19 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:old_style gen-py-oldstyle) |
| 20 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:no_utf8strings gen-py-no_utf8strings) |
Roger Meier | a03464c | 2015-09-30 08:15:53 +0200 | [diff] [blame] | 21 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic gen-py-dynamic) |
| 22 | generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic,slots gen-py-dynamicslots) |
Eric Conner | c34653f | 2017-06-21 03:34:12 +0200 | [diff] [blame^] | 23 | |
| 24 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py gen-py-default) |
| 25 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:slots gen-py-slots) |
| 26 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:old_style gen-py-oldstyle) |
| 27 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:no_utf8strings gen-py-no_utf8strings) |
| 28 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:dynamic gen-py-dynamic) |
| 29 | generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:dynamic,slots gen-py-dynamicslots) |