Install an external project BEFORE configuring subdirs

Hello! I’m using xtensor and xtensor-python in my projects. I’d like it very much if I could somehow pecify that these need to be installed before my project is configured. I’d also like to do this superbuild-style, like in FetchContent, since these are header-only.

Note that ExternalProject_add doesn’t mix well with add_library (i.e., if you use EP_add for your dependencies, you should also build your project that way). But I think FetchContent is as close as you can get otherwise.

Cc: @craig.scott

If they are header-only, do you actually need to install them? If you are already using FetchContent, the question is whether those projects define the same targets as when you have them installed and find them with find_package() instead. If they do define the same targets, then you should be fine using FetchContent to bring them into the main build. You’d have to provide more details about what you tried and what didn’t work to be able to help you any further.

The problem is ProjectConfig.cmake only exists after an installation, and all the targets are defined there.

As well as: