diff options
author | David Cole <david.cole@kitware.com> | 2009-07-02 21:38:30 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-07-02 21:38:30 (GMT) |
commit | 10f4e911f09eccf1af3641b1555f53f976d5db93 (patch) | |
tree | d15907e2272535d60e550c61bde5430935d188e4 /Modules/ExternalProject.cmake | |
parent | 5b51ad580bd716a21bda73898f4421e0fdbb3b83 (diff) | |
download | CMake-10f4e911f09eccf1af3641b1555f53f976d5db93.zip CMake-10f4e911f09eccf1af3641b1555f53f976d5db93.tar.gz CMake-10f4e911f09eccf1af3641b1555f53f976d5db93.tar.bz2 |
BUG: Allow arbitrary text in values for some keywords. (And avoid warning that the arbitrary text is an unknown keyword.)
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r-- | Modules/ExternalProject.cmake | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 9221814..5465875 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -121,31 +121,45 @@ function(_ep_parse_arguments f name ns args) # upper-case letter followed by at least two more upper-case letters # or underscores to be keywords. set(key) + foreach(arg IN LISTS args) + set(is_value 1) + if(arg MATCHES "^[A-Z][A-Z_][A-Z_]+$" AND NOT ((arg STREQUAL "${key}") AND (key STREQUAL "COMMAND")) AND NOT arg MATCHES "^(TRUE|FALSE)$") - # Keyword - set(key "${arg}") - if(_ep_keywords_${f} AND NOT key MATCHES "${_ep_keywords_${f}}") - message(AUTHOR_WARNING "unknown ${f} keyword: ${key}") - endif() - elseif(key) - # Value - if(NOT arg STREQUAL "") - set_property(TARGET ${name} APPEND PROPERTY ${ns}${key} "${arg}") + if(_ep_keywords_${f} AND arg MATCHES "${_ep_keywords_${f}}") + set(is_value 0) else() - get_property(have_key TARGET ${name} PROPERTY ${ns}${key} SET) - if(have_key) - get_property(value TARGET ${name} PROPERTY ${ns}${key}) - set_property(TARGET ${name} PROPERTY ${ns}${key} "${value};${arg}") + if(NOT (key STREQUAL "COMMAND") + AND NOT (key STREQUAL "CVS_MODULE") + AND NOT (key STREQUAL "DEPENDS") + ) + message(AUTHOR_WARNING "unknown ${f} keyword: ${arg}") + endif() + endif() + endif() + + if(is_value) + if(key) + # Value + if(NOT arg STREQUAL "") + set_property(TARGET ${name} APPEND PROPERTY ${ns}${key} "${arg}") else() - set_property(TARGET ${name} PROPERTY ${ns}${key} "${arg}") + get_property(have_key TARGET ${name} PROPERTY ${ns}${key} SET) + if(have_key) + get_property(value TARGET ${name} PROPERTY ${ns}${key}) + set_property(TARGET ${name} PROPERTY ${ns}${key} "${value};${arg}") + else() + set_property(TARGET ${name} PROPERTY ${ns}${key} "${arg}") + endif() endif() + else() + # Missing Keyword + message(AUTHOR_WARNING "value '${arg}' with no previous keyword in ${f}") endif() else() - # Missing Keyword - message(AUTHOR_WARNING "value with no keyword in ${f}") + set(key "${arg}") endif() endforeach() endfunction(_ep_parse_arguments) |