diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2016-10-18 16:50:46 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2016-10-18 16:51:06 (GMT) |
commit | fdce782b61c6a1501b6ea2459c659d9a42bae59b (patch) | |
tree | 2af20edf5cecab6c1361598474b872729555e139 /Modules | |
parent | b99bbfe88d1bb02dc903507f3e1bbe716ac04c12 (diff) | |
download | CMake-fdce782b61c6a1501b6ea2459c659d9a42bae59b.zip CMake-fdce782b61c6a1501b6ea2459c659d9a42bae59b.tar.gz CMake-fdce782b61c6a1501b6ea2459c659d9a42bae59b.tar.bz2 |
ExternalProject: error out only if the property is unset
Property values may be empty; instead make sure they exist and allow for
empty values.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index bbeeeed..e3bdc6d 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1184,10 +1184,11 @@ endfunction() function(ExternalProject_Get_Property name) foreach(var ${ARGN}) string(TOUPPER "${var}" VAR) - get_property(${var} TARGET ${name} PROPERTY _EP_${VAR}) - if(NOT ${var}) + get_property(is_set TARGET ${name} PROPERTY _EP_${VAR} SET) + if(NOT is_set) message(FATAL_ERROR "External project \"${name}\" has no ${var}") endif() + get_property(${var} TARGET ${name} PROPERTY _EP_${VAR}) set(${var} "${${var}}" PARENT_SCOPE) endforeach() endfunction() |