diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2019-01-17 18:34:45 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2019-01-17 18:40:30 (GMT) |
commit | c09ec7998148e3c69bf0c7fd2d626a6ccc23e37e (patch) | |
tree | de68ca2e357a41d02e58a23c87ecb020c9288899 /Modules | |
parent | 68e20f674a48be38d60e129f600faf7c483f2b97 (diff) | |
download | CMake-c09ec7998148e3c69bf0c7fd2d626a6ccc23e37e.zip CMake-c09ec7998148e3c69bf0c7fd2d626a6ccc23e37e.tar.gz CMake-c09ec7998148e3c69bf0c7fd2d626a6ccc23e37e.tar.bz2 |
ExternalProject: support SOURCE_SUBDIR for BUILD_IN_SOURCE
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index e763bab..c5d6b45 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -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 |