Skip to content
Snippets Groups Projects
Commit 042e857f authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[cmake] Small cleanup and added documentation

parent fe05ec34
No related branches found
No related tags found
No related merge requests found
...@@ -279,10 +279,13 @@ macro(extract_line HEADER OUTPUT FILE_NAME) ...@@ -279,10 +279,13 @@ macro(extract_line HEADER OUTPUT FILE_NAME)
endif() endif()
endmacro(extract_line) 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) macro(split_module_version STRING MODULES VERSIONS)
set(REGEX "[a-zA-Z-]+[ ]*(\\([ ]*([^ ]+)?[ ]*[^ ]+[ ]*\\))?") set(REGEX "[a-zA-Z-]+[ ]*(\\([ ]*([^ ]+)?[ ]*[^ ]+[ ]*\\))?")
#set(REGEX "dune") string(REGEX MATCHALL "${REGEX}" matches "${STRING}")
string(REGEX MATCHALL "${REGEX}" matches "${STRING}")
set(${MODULES} "") set(${MODULES} "")
set(${VERSIONS} "") set(${VERSIONS} "")
foreach(i ${matches}) foreach(i ${matches})
...@@ -302,6 +305,9 @@ macro(split_module_version STRING MODULES VERSIONS) ...@@ -302,6 +305,9 @@ macro(split_module_version STRING MODULES VERSIONS)
endforeach() endforeach()
endmacro(split_module_version) endmacro(split_module_version)
#
# Convert a string with spaces in a list which is a string with semicolon
#
function(convert_deps_to_list var) function(convert_deps_to_list var)
string(REGEX REPLACE "([a-zA-Z\\)]) ([a-zA-Z])" "\\1;\\2" ${var} ${${var}}) string(REGEX REPLACE "([a-zA-Z\\)]) ([a-zA-Z])" "\\1;\\2" ${var} ${${var}})
set(${var} ${${var}} PARENT_SCOPE) set(${var} ${${var}} PARENT_SCOPE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment