Using CMake with setup.py

前端 未结 1 502
囚心锁ツ
囚心锁ツ 2021-02-01 07:50

For a project I build a C library and implict Python bindings (via GObject introspection) with CMake. I also want to distribute some Python helper modules using distutils. I am

相关标签:
1条回答
  • 2021-02-01 08:12

    Only files, not directories, can be reliably used as OUTPUT and DEPENDS. You could modify your custom command to also produce a timestamp file, something like this:

    add_custom_command(
      OUTPUT ${OUTPUT}/timestamp
      COMMAND ${PYTHON} setup.py build
      COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}/timestamp
      DEPENDS ${DEPS}
    )
    
    add_custom_target(target ALL DEPENDS ${OUTPUT}/timestamp)
    
    0 讨论(0)
提交回复
热议问题