diff options
author | Brad King <brad.king@kitware.com> | 2019-01-21 12:58:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-21 12:58:10 (GMT) |
commit | 02f7e997e939dbd0c753514edcd580083cebd37c (patch) | |
tree | fba670bb8c0656acfb21e6d95a54c14e74cf391d /Modules | |
parent | c7428e1729239264af84cb9ecb6f05f0b1e04e84 (diff) | |
parent | c09ec7998148e3c69bf0c7fd2d626a6ccc23e37e (diff) | |
download | CMake-02f7e997e939dbd0c753514edcd580083cebd37c.zip CMake-02f7e997e939dbd0c753514edcd580083cebd37c.tar.gz CMake-02f7e997e939dbd0c753514edcd580083cebd37c.tar.bz2 |
Merge topic 'ExternalProject-non-cmake-source-subdir'
c09ec79981 ExternalProject: support SOURCE_SUBDIR for BUILD_IN_SOURCE
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2823
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 |