lazy-c++

How do I make build rules in cmake to preprocess lazy C++ .lzz files that generate .h and .cpp files?

泪湿孤枕 提交于 2019-11-30 09:34:44
What I'd like to do is write just Lazy C++ .lzz files and then have lzz run before a build to generate .cpp and .h files that will be built into the final application, sort of like how moc works with Qt. Is there any way to do this? Here is an example of how to do this... First you need to find the lzz program, for that use the find_program command: find_program(LZZ_COMMAND lzz) This sets LZZ_COMMAND to the path of the compiler. Then use a CMake custom command to compile the LZZ file to their C++ header/implementation files: add_custom_command( OUTPUT ${output} COMMAND ${LZZ_COMMAND} -o $

How do I make build rules in cmake to preprocess lazy C++ .lzz files that generate .h and .cpp files?

六月ゝ 毕业季﹏ 提交于 2019-11-29 13:59:32
问题 What I'd like to do is write just Lazy C++ .lzz files and then have lzz run before a build to generate .cpp and .h files that will be built into the final application, sort of like how moc works with Qt. Is there any way to do this? 回答1: Here is an example of how to do this... First you need to find the lzz program, for that use the find_program command: find_program(LZZ_COMMAND lzz) This sets LZZ_COMMAND to the path of the compiler. Then use a CMake custom command to compile the LZZ file to