Using flatc with cmake

1,535 views
Skip to first unread message

Jun Zhang

unread,
Jun 15, 2015, 2:21:24 AM6/15/15
to flatb...@googlegroups.com
Hi

I try to automate the code generation with cmake, which should be some add_custom_command.

However, I see flatbuffers carry a FindFlatBuffers.cmake file, which is supposed to provide some out-of-box cmake add_custom_command support.

I see there is a function

    FLATBUFFERS_GENERATE_C_HEADERS

that accepts a list of ".fbs" files and generate the header. But neither do the generated source appear, nor can I add a target to force the generation.

Have anybody use this one successfully? Could anyone give some cmake code examples on using it?

Thanks a lot
Ralph

Wouter van Oortmerssen

unread,
Jun 15, 2015, 3:02:51 PM6/15/15
to Jun Zhang, flatb...@googlegroups.com
In the main CMakeLists.txt there is a compile_flatbuffers_schema_to_cpp() function, have you tried that?

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages