My project is currently using ExternalProject_Add to obtain the source code of an external library. By default ExternalProject_Add downloads data from a URL: is it possible to point it to an existing directory, already downloaded by git with git submodule init, git submodule update... ?
1 Answer
Just set the SOURCE_DIR argument without any additional download options.
Source directory into which downloaded contents will be unpacked, or for non-URL download methods, the directory in which the repository should be checked out, cloned, etc. If no download method is specified, this must point to an existing directory where the external project has already been unpacked or cloned/checked out.
See the docs: https://cmake.org/cmake/help/latest/module/ExternalProject.html
add_subdirectory()command help you with this?ExternalProject_AddI can easily pass configuration options to the library I need to compile viaCMAKE_ARGSand such.