diff options
author | Brad King <brad.king@kitware.com> | 2019-03-01 12:54:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-01 12:54:17 (GMT) |
commit | a6d3fee77cb526457ab3c5d427f93530f7621b2b (patch) | |
tree | db0bc503c8bca613d3cc0079ec5c26ab923fcfa7 /Modules/ExternalProject.cmake | |
parent | e6897c72e7c59f7a0b82ed19c1bdb40d42f7adaa (diff) | |
download | CMake-a6d3fee77cb526457ab3c5d427f93530f7621b2b.zip CMake-a6d3fee77cb526457ab3c5d427f93530f7621b2b.tar.gz CMake-a6d3fee77cb526457ab3c5d427f93530f7621b2b.tar.bz2 |
ExternalProject: Restore default log dir with custom stamp dir
In commit b6f6cac378 (ExternalProject: add LOG_DIR option that allows
overriding of log location, 2018-10-12, v3.14.0-rc1~515^2~1) the log
directory got its own option. The intention was to fall back to the
stamp directory by default. However, the implementation actually only
falls back to the same default as the stamp directory and does not
consider a custom stamp dir.
Update the default log dir computation to fall back to whatever is the
final selection for the stamp dir.
Fixes: #19000
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r-- | Modules/ExternalProject.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index c5d6b45..8c943c5 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1643,7 +1643,6 @@ function(_ep_set_directories name) set(stamp_default "${base}/Stamp/${name}") set(install_default "${base}/Install/${name}") endif() - set(log_default "${stamp_default}") get_property(build_in_source TARGET ${name} PROPERTY _EP_BUILD_IN_SOURCE) if(build_in_source) get_property(have_binary_dir TARGET ${name} PROPERTY _EP_BINARY_DIR SET) @@ -1653,7 +1652,9 @@ function(_ep_set_directories name) endif() endif() set(top "${CMAKE_CURRENT_BINARY_DIR}") - set(places stamp download source binary install tmp log) + + # Apply defaults and convert to absolute paths. + set(places stamp download source binary install tmp) foreach(var ${places}) string(TOUPPER "${var}" VAR) get_property(${var}_dir TARGET ${name} PROPERTY _EP_${VAR}_DIR) @@ -1665,6 +1666,17 @@ function(_ep_set_directories name) endif() set_property(TARGET ${name} PROPERTY _EP_${VAR}_DIR "${${var}_dir}") endforeach() + + # Special case for default log directory based on stamp directory. + get_property(log_dir TARGET ${name} PROPERTY _EP_LOG_DIR) + if(NOT log_dir) + get_property(log_dir TARGET ${name} PROPERTY _EP_STAMP_DIR) + endif() + if(NOT IS_ABSOLUTE "${log_dir}") + get_filename_component(log_dir "${top}/${log_dir}" ABSOLUTE) + endif() + set_property(TARGET ${name} PROPERTY _EP_LOG_DIR "${log_dir}") + get_property(source_subdir TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR) if(NOT source_subdir) set_property(TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR "") |