Intro Q: ExternalProject or add_subdirectory/FetchContent when no download need? we use ExternalProject here to get maximum isolation between the thirdparty library and our codebase, especially because CMake scripts of our base project is quiet messy and customized and may pollute the thirdparty building if using add_subdirectory.
There’re two steps to do:
Use ExternalProject_Add to configure, build and install the dependency. Setup the dependency as an imported library for other targets to “link”.