Cmake to automatically create summary code

So the only decent example I've found for this is http://grokbase.com/t/thrift/user/1162hvgrdn/recommended-way-to-incorporate-thrift-to-the-build-system , however it It looks rather unsuccessful, for example, if $ {THRIFT_FILE} is missing in the if statement.

This suggests that I am catching up with the execute prcoess command, returning: "execute_process the uknown argument is set to" STUFF ", where the material is what looks like the right thrift command.

Any suggestions and what's wrong here?

+6
source share
1 answer

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

+6
source

Source: https://habr.com/ru/post/926415/


All Articles