From 042e857f98356d9f7a3a272e79b71add4fc4df8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org> Date: Mon, 24 Oct 2016 23:50:15 +0200 Subject: [PATCH] [cmake] Small cleanup and added documentation --- cmake/modules/DuneMacros.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake index 1a8de220d..2266ebe5d 100644 --- a/cmake/modules/DuneMacros.cmake +++ b/cmake/modules/DuneMacros.cmake @@ -279,10 +279,13 @@ macro(extract_line HEADER OUTPUT FILE_NAME) endif() endmacro(extract_line) +# +# split list of modules, potentially with version information +# into list of modules and list of versions +# macro(split_module_version STRING MODULES VERSIONS) set(REGEX "[a-zA-Z-]+[ ]*(\\([ ]*([^ ]+)?[ ]*[^ ]+[ ]*\\))?") - #set(REGEX "dune") - string(REGEX MATCHALL "${REGEX}" matches "${STRING}") + string(REGEX MATCHALL "${REGEX}" matches "${STRING}") set(${MODULES} "") set(${VERSIONS} "") foreach(i ${matches}) @@ -302,6 +305,9 @@ macro(split_module_version STRING MODULES VERSIONS) endforeach() endmacro(split_module_version) +# +# Convert a string with spaces in a list which is a string with semicolon +# function(convert_deps_to_list var) string(REGEX REPLACE "([a-zA-Z\\)]) ([a-zA-Z])" "\\1;\\2" ${var} ${${var}}) set(${var} ${${var}} PARENT_SCOPE) -- GitLab