diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-10-18 14:55:24 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2016-10-18 16:51:38 (GMT) |
commit | 615f3ed2b43129bd7d2466d369beef3003e1e0de (patch) | |
tree | 4f4eb022c342236ea93b00878323f6a841e76819 | |
parent | fdce782b61c6a1501b6ea2459c659d9a42bae59b (diff) | |
download | CMake-615f3ed2b43129bd7d2466d369beef3003e1e0de.zip CMake-615f3ed2b43129bd7d2466d369beef3003e1e0de.tar.gz CMake-615f3ed2b43129bd7d2466d369beef3003e1e0de.tar.bz2 |
ExternalProject: make SOURCE_SUBDIR directly appendable
This allows it to be used in expansions without being conditional based
on its value.
-rw-r--r-- | Modules/ExternalProject.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index e3bdc6d..1f64701 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1087,10 +1087,14 @@ function(_ep_set_directories name) endforeach() get_property(source_subdir TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR) if(NOT source_subdir) - set_property(TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR ".") + set_property(TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR "") elseif(IS_ABSOLUTE "${source_subdir}") message(FATAL_ERROR "External project ${name} has non-relative SOURCE_SUBDIR!") + else() + # Prefix with a slash so that when appended to the source directory, it + # behaves as expected. + set_property(TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR "/${source_subdir}") endif() if(build_in_source) get_property(source_dir TARGET ${name} PROPERTY _EP_SOURCE_DIR) @@ -2257,11 +2261,7 @@ function(_ep_add_configure_command name) endif() endif() - if(source_subdir STREQUAL ".") - list(APPEND cmd "${source_dir}") - else() - list(APPEND cmd "${source_dir}/${source_subdir}") - endif() + list(APPEND cmd "${source_dir}${source_subdir}") endif() # If anything about the configure command changes, (command itself, cmake |