2015-09-30 06:15:53 +00:00
|
|
|
macro(GENERATE FILENAME GENERATOR OUTPUTDIR)
|
2016-01-06 11:44:17 +00:00
|
|
|
file(MAKE_DIRECTORY ${MY_CURRENT_BINARY_DIR}/${OUTPUTDIR})
|
|
|
|
execute_process(COMMAND ${THRIFTCOMPILER} --gen ${GENERATOR} -out ${MY_CURRENT_BINARY_DIR}/${OUTPUTDIR} ${FILENAME}
|
2015-09-30 06:15:53 +00:00
|
|
|
RESULT_VARIABLE CMD_RESULT)
|
|
|
|
if(CMD_RESULT)
|
|
|
|
message(FATAL_ERROR "Error generating ${FILENAME} with generator ${GENERATOR}")
|
|
|
|
endif()
|
|
|
|
endmacro(GENERATE)
|
|
|
|
|
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py gen-py-default)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:slots gen-py-slots)
|
2016-01-06 11:44:17 +00:00
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:old_style gen-py-oldstyle)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:no_utf8strings gen-py-no_utf8strings)
|
2015-09-30 06:15:53 +00:00
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic gen-py-dynamic)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic,slots gen-py-dynamicslots)
|
|
|
|
|
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py gen-py-default)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:slots gen-py-slots)
|
2016-01-06 11:44:17 +00:00
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:old_style gen-py-oldstyle)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:no_utf8strings gen-py-no_utf8strings)
|
2015-09-30 06:15:53 +00:00
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic gen-py-dynamic)
|
|
|
|
generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic,slots gen-py-dynamicslots)
|