ExternalProject: support SOURCE_SUBDIR for BUILD_IN_SOURCE

This commit is contained in:
Ben Boeckel
2019-01-17 13:34:45 -05:00
parent 68e20f674a
commit c09ec79981
5 changed files with 49 additions and 2 deletions

View File

@@ -425,7 +425,9 @@ External Project Definition
can be used to point to an alternative directory within the source tree
to use as the top of the CMake source tree instead. This must be a
relative path and it will be interpreted as being relative to
``SOURCE_DIR``.
``SOURCE_DIR``. When ``BUILD_IN_SOURCE 1`` is specified, the
``BUILD_COMMAND`` is used to point to an alternative directory within the
source tree.
**Build Step Options:**
If the configure step assumed the external project uses CMake as its build
@@ -1676,7 +1678,11 @@ function(_ep_set_directories name)
endif()
if(build_in_source)
get_property(source_dir TARGET ${name} PROPERTY _EP_SOURCE_DIR)
set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}")
if(source_subdir)
set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}/${source_subdir}")
else()
set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}")
endif()
endif()
# Make the directories at CMake configure time *and* add a custom command