1

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... ?

2
  • Wouldn't the add_subdirectory() command help you with this? Commented Jul 10, 2022 at 19:44
  • @Geo as far as I understand, wtih ExternalProject_Add I can easily pass configuration options to the library I need to compile via CMAKE_ARGS and such. Commented Jul 10, 2022 at 20:19

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.