diff options
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r-- | Modules/ExternalProject.cmake | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 3ba91de..f587985 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -201,11 +201,11 @@ file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT ${_ep_documentation_line_count} REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()") foreach(line IN LISTS lines) - if("${line}" MATCHES "^# [A-Za-z0-9_]+\\(") + if("${line}" MATCHES "^# ([A-Za-z0-9_]+)\\(") if(_ep_func) set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$") endif() - string(REGEX REPLACE "^# ([A-Za-z0-9_]+)\\(.*" "\\1" _ep_func "${line}") + set(_ep_func "${CMAKE_MATCH_1}") #message("function [${_ep_func}]") set(_ep_keywords_${_ep_func} "^(") set(_ep_keyword_sep) @@ -907,7 +907,8 @@ function(_ep_write_initial_cache target_name script_filename args) set(regex "^([^:]+):([^=]+)=(.*)$") set(setArg "") foreach(line ${args}) - if("${line}" MATCHES "^-D") + if("${line}" MATCHES "^-D(.*)") + set(line "${CMAKE_MATCH_1}") if(setArg) # This is required to build up lists in variables, or complete an entry set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)") @@ -915,9 +916,7 @@ function(_ep_write_initial_cache target_name script_filename args) set(accumulator "") set(setArg "") endif() - string(REGEX REPLACE "^-D" "" line ${line}) if("${line}" MATCHES "${regex}") - string(REGEX MATCH "${regex}" match "${line}") set(name "${CMAKE_MATCH_1}") set(type "${CMAKE_MATCH_2}") set(value "${CMAKE_MATCH_3}") |