In a CMakeLists.txt
, I retrieve a Git repository with the commands:
include(FetchContent)
FetchContent_Declare(
CMakeScripts
GIT_REPOSITORY <Git repository>
GIT_TAG <hash code>
)
FetchContent_MakeAvailable(CMakeScripts)
FetchContent_GetProperties(CMakeScripts SOURCE_DIR CMakeScripts_SOURCE_DIR)
But actually, I need only one file:
include(${CMakeScripts_SOURCE_DIR}/cmake/Utils.cmake)
How to avoid retrieving the full repository?
3