I am using FetchContent_MakeAvailable in my project, and the code is:
include(FetchContent)
FetchContent_Declare(opencv
GIT_REPOSITORY "https://github.com/opencv/opencv.git"
GIT_TAG "origin/master"
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/opencvc"
)
FetchContent_MakeAvailable(opencv)
It can fetch opencv
repository sucessfully. However, I need to manually checkout master branch.
Is it possible to automatically git checkout master by FetchContent_Declare or FetchContent_MakeAvailable.