【问题标题】:Cmake to autogenerate thrift codeCmake 自动生成节俭代码
【发布时间】:2012-09-27 14:38:22
【问题描述】:

所以我找到的唯一不错的例子是 http://grokbase.com/t/thrift/user/1162hvgrdn/recommended-way-to-incorporate-thrift-to-the-build-system ,但是它似乎有很多错误,例如 if 语句缺少 ${THRIFT_FILE} 。

也就是说,我正忙于执行执行命令返回:“execute_process given uknown argument - “STUFF”,其中的东西看起来是一个合适的节俭命令。

有什么建议吗?这里有什么问题?

【问题讨论】:

    标签: build cmake thrift


    【解决方案1】:

    迟到总比永不好。 使用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}
    )
    

    我用它为 Apache thrift here 生成与测试相关的东西

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 2010-12-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多