简体   繁体   中英

Can I get CMake to do a git checkout of a project during build

I see that there is a FindGit module in CMake but can I use that to have CMake check out a specific revision of some software on build?

I'd like to be able to specify several repositories and at build they should all be checked out and built together with my application.

[edit] To be clear, when I say several repositories and built together I mean that the sources from the repositories should be fetched and that those sources should compile together with my application sources. The reason being that I want a "platform" consisting of FreeRTOS, LwIP, mbed-tls and so on. This "platform" should be usable from many different projects but since each of the platform components needs to be built with different configurations for different projects I need to compile their sources together with my application. Then it is all linked together and one single hex file is produced.

I think ExternalProject_Add is what you need.

[GIT_TAG tag] # Git branch name, commit id or tag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM