shashashamti2008
shashashamti2008

Reputation: 2337

Prevent FetchContent from being re-configured if already configured

I have several FetchContents Github repos in my CMakeLists.txt and they get reconfigured by CMake every time I modify my CMakeLists.txt:

FetchContent_Declare(fmt GIT_REPOSITORY https://github.com/fmtlib/fmt)
FetchContent_MakeAvailable(fmt)

FetchContent_Declare(glfw GIT_REPOSITORY https://github.com/glfw/glfw) 
FetchContent_MakeAvailable(glfw)

# Several more GitHub repositories using FetchContent
# ...

Is it possible to set FetchContent to skip the library that is already FetchContented?

Upvotes: 0

Views: 854

Answers (0)

Related Questions