FetchContent store content outside of build tree w/ multiple generators
So, typically I use FetchContent to download external dependencies. Those can be large (> 500 MiB), and I don't want to duplicate them for Debug/Release configurations, etc. So I set FETCHCONTENT_BASE_DIR to point to something outside of the build tree, like <myrepo>/external/
. It works well in general. Problem is I sometimes switch between different IDEs (Sublime, VSCode, CLion, etc.), and sometimes I have to use a different generator (ninja/make).
To prevent conflicts between the different generators, I thus need to set different SUBBUILD_DIR (and possibly DOWNLOAD_DIR?) for my dependencies. It would be nice if we could have a FETCHCONTENT_SUBBUILD_DIR for example, to control those (with the assumption that we don't run two different configure at the same type, which is generally true).
Let me know if that makes sense.