diff options
author | Brad King <brad.king@kitware.com> | 2019-03-01 14:07:42 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-01 14:08:15 (GMT) |
commit | 4cda0b66fa67bdf1ef0e3c859e49039366b981ff (patch) | |
tree | 23d829867bf8c191ccf2fbe882e62f42cd22ad1b /Modules/ExternalProject.cmake | |
parent | 8b1716a62a4209d274cfb2334aa2330f21d6dbcb (diff) | |
parent | a6d3fee77cb526457ab3c5d427f93530f7621b2b (diff) | |
download | CMake-4cda0b66fa67bdf1ef0e3c859e49039366b981ff.zip CMake-4cda0b66fa67bdf1ef0e3c859e49039366b981ff.tar.gz CMake-4cda0b66fa67bdf1ef0e3c859e49039366b981ff.tar.bz2 |
Merge topic 'ExternalProject-fix-log-in-custom-stamp'
a6d3fee77c ExternalProject: Restore default log dir with custom stamp dir
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3045
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 e097894..22e0523 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1644,7 +1644,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) @@ -1654,7 +1653,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) @@ -1666,6 +1667,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 "") |