Merge branch 'external-project-source-subdir-usage' into release

This commit is contained in:
Brad King 2016-10-18 12:56:13 -04:00
commit e3cb3116bc
1 changed files with 9 additions and 8 deletions

View File

@ -1087,10 +1087,14 @@ function(_ep_set_directories name)
endforeach() endforeach()
get_property(source_subdir TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR) get_property(source_subdir TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR)
if(NOT 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}") elseif(IS_ABSOLUTE "${source_subdir}")
message(FATAL_ERROR message(FATAL_ERROR
"External project ${name} has non-relative SOURCE_SUBDIR!") "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() endif()
if(build_in_source) if(build_in_source)
get_property(source_dir TARGET ${name} PROPERTY _EP_SOURCE_DIR) get_property(source_dir TARGET ${name} PROPERTY _EP_SOURCE_DIR)
@ -1184,10 +1188,11 @@ endfunction()
function(ExternalProject_Get_Property name) function(ExternalProject_Get_Property name)
foreach(var ${ARGN}) foreach(var ${ARGN})
string(TOUPPER "${var}" VAR) string(TOUPPER "${var}" VAR)
get_property(${var} TARGET ${name} PROPERTY _EP_${VAR}) get_property(is_set TARGET ${name} PROPERTY _EP_${VAR} SET)
if(NOT ${var}) if(NOT is_set)
message(FATAL_ERROR "External project \"${name}\" has no ${var}") message(FATAL_ERROR "External project \"${name}\" has no ${var}")
endif() endif()
get_property(${var} TARGET ${name} PROPERTY _EP_${VAR})
set(${var} "${${var}}" PARENT_SCOPE) set(${var} "${${var}}" PARENT_SCOPE)
endforeach() endforeach()
endfunction() endfunction()
@ -2256,11 +2261,7 @@ function(_ep_add_configure_command name)
endif() endif()
endif() endif()
if(source_subdir STREQUAL ".") list(APPEND cmd "${source_dir}${source_subdir}")
list(APPEND cmd "${source_dir}")
else()
list(APPEND cmd "${source_dir}/${source_subdir}")
endif()
endif() endif()
# If anything about the configure command changes, (command itself, cmake # If anything about the configure command changes, (command itself, cmake