summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/HelperFunctions.cmake
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-03-14 16:37:50 +0000
committerJabiertxof <jtx@jtx.marker.es>2016-03-14 16:37:50 +0000
commitb8d22beef5345210ad27cdc2685083aeae6f8f3b (patch)
treed69b8bfd19d3627a8425a1b265c2abf229b05354 /CMakeScripts/HelperFunctions.cmake
parentfixes for update to trunk (diff)
parent"Relative to" option for node alignment. (diff)
downloadinkscape-b8d22beef5345210ad27cdc2685083aeae6f8f3b.tar.gz
inkscape-b8d22beef5345210ad27cdc2685083aeae6f8f3b.zip
update to trunk
(bzr r13708.1.39)
Diffstat (limited to 'CMakeScripts/HelperFunctions.cmake')
-rw-r--r--CMakeScripts/HelperFunctions.cmake19
1 files changed, 17 insertions, 2 deletions
diff --git a/CMakeScripts/HelperFunctions.cmake b/CMakeScripts/HelperFunctions.cmake
index 0e6fff51a..f4ed255d5 100644
--- a/CMakeScripts/HelperFunctions.cmake
+++ b/CMakeScripts/HelperFunctions.cmake
@@ -12,8 +12,23 @@ function(pkg_check_variable _pkg _name)
set(_output_name "${_pkg_upper}_${_name_upper}")
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_name} ${_pkg}
- OUTPUT_VARIABLE _pkg_result
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+ OUTPUT_VARIABLE _pkg_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
set("${_output_name}" "${_pkg_result}" CACHE STRING "pkg-config variable ${_name} of ${_pkg}")
endfunction()
+
+# Join a cmake list of strings with a given glue character/string
+# E.g. join(MY_RESULT, ",", "1; 2; 3;") returns "1, 2, 3"
+function(join OUTPUT GLUE)
+ set(_TMP_RESULT "")
+ set(_GLUE "") # effective glue is empty at the beginning
+ foreach(arg ${ARGN})
+ # Skip empty lines
+ if(NOT arg STREQUAL "\n")
+ set(_TMP_RESULT "${_TMP_RESULT}${_GLUE}${arg}")
+ set(_GLUE "${GLUE}")
+ endif()
+ endforeach()
+ set(${OUTPUT} "${_TMP_RESULT}" PARENT_SCOPE)
+endfunction()