[CMake] Parent component options passed to ExternalProject

Dustyn Blasig dustyn at blasig.us
Mon Mar 25 13:02:01 EDT 2019


Hi All,

I'm really struggling to use ExternalProject_Add() in our CMake project.

Based on the documentation, I was expecting the simplest Git-based external
project with all defaults to act just like using a Git submodule locked at
a specific commit.

include(ExternalProject)ExternalProject_Add(foobar  GIT_REPOSITORY
git at github.com:FooCo/FooBar.git  GIT_TAG
origin/release/1.2.3)

The documentation states "The default configure command runs CMake with
options based on the main project.", so I was expecting any options we pass
to the owning project such as CMAKE_INSTALL_PREFIX and other variables
would get propagated to the ExternalProject. However, that doesn't seem to
be the case. Do I need to explicitly apply every variable through the
"CMAKE_ARGS" options? If so,

Also, unless I specify a custom CONFIGURE_COMMAND, I can't figure out how
to make the configure step happen during the parent projects configure
step. Should that be happening? If not, is there a simple way to force it
to happen without having to duplicate everything the default options do?
I'm seeing mixed results with online resources, along with many older
examples that just don't work anymore.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190325/f8576eeb/attachment.html>


More information about the CMake mailing list