Better late, then never. Use add_custom_command
add_custom_command( OUTPUT ${GEN_FILES_PATH}/DebugProtoTest_types.cpp ${GEN_FILES_PATH}/DebugProtoTest_types.h COMMAND $<TARGET_FILE:compiler> --gen cpp:dense ${TEST_PATH}/DebugProtoTest.thrift DEPENDS compiler WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
I use it to create test materials for Apache lean here
source share