include(FetchContent) if(NOT DEFINED STB_REPO) set(STB_REPO https://github.com/nothings/stb.git) endif () FetchContent_Declare( stb EXCLUDE_FROM_ALL GIT_REPOSITORY ${STB_REPO} GIT_SHALLOW TRUE ) FetchContent_MakeAvailable(stb) add_library(stb INTERFACE) target_include_directories(stb INTERFACE ${stb_SOURCE_DIR})