FetchContent and Compiler launcher

I want to know if the FetchContent and ExternalProject consider the CMAKE_CXX_COMPILER_LAUNCHER=ccache. Thx

1 Like

FetchContent brings things directly into the main build, so whatever you set up for the compiler will also apply to the dependencies brought in this way. In other words, CMAKE_CXX_COMPILER_LAUNCHER will also apply to the dependency (unless it has its own logic that overrides it).

ExternalProject sets up a separate child build, and from what I recall, it won’t propagate CMAKE_CXX_COMPILER_LAUNCHER to that sub-build. In general, it isn’t guaranteed to be safe for it to propagate that setting, because the external project could be using an entirely different toolchain, one which might not work with the launcher.


Thx for reply, it makes sense