A cmake module taking care of a project's git submodules (and checking out specific commits/tags)
- cmake
- already added git submodules (preferably in
vendor/but you can set this to another direcotory insidesubmodules.cmake) - adjust
submodules.cmaketo the git submodules you have added to your repo:- in this example I am using two submodules under
vendor/serialization, andvendor/testingrespectively.
- in this example I am using two submodules under
Include submodules.cmake in your main CMakeLists.txt file:
include(cmake/submodules.cmake)
Then run cmake as usual from the out-of-source build-directory:
build$ cmake ..