admin管理员组文章数量:1122846
I have a CMake project that generates build artifacts based on some image files using GLOB
like so:
file(GLOB IN_FILES ${CMAKE_SOURCE_DIR}/images/*.png)
add_custom_command(
OUTPUT ${OUT_FILE}
COMMAND command-to-generate-build-artifact.sh
DEPENDS ${IN_FILES}
COMMENT "Generating stuff"
)
add_custom_target(generate_image_data ALL DEPENDS ${OUT_FILE})
add_dependencies(project generate_image_data)
The annoying thing about this is that if I add, remove, or rename any of these images, I need to remember to manually reconfigure CMake, and I pretty much always forget to do this, meaning my next build will break and it'll take me a moment to remember why.
Is there some way I can either change my CMakeLists.txt file so that reconfiguring isn't necessary, or set things up so that CMake automatically reconfigures itself when these files change? I'm using Visual Studio Code for this project.
本文标签:
版权声明:本文标题:visual studio code - How can a VSCode + CMake project automatically reconfigure when adding, removing or renaming certain files? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300725a1930922.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论