Code

Cmake: Moved helper macros to their own file and removed *-test.h from inkscape sourc...
[inkscape.git] / CMakeScripts / HelperMacros.cmake
diff --git a/CMakeScripts/HelperMacros.cmake b/CMakeScripts/HelperMacros.cmake
new file mode 100644 (file)
index 0000000..dd8c25f
--- /dev/null
@@ -0,0 +1,13 @@
+# A macro to replace slashes and spaces in a string with underscores\r
+MACRO(SANITIZE_PATH _string_var)\r
+  STRING(REGEX REPLACE "[\\/ ]+" "_" ${_string_var} ${${_string_var}})\r
+ENDMACRO(SANITIZE_PATH _string_var)\r
+\r
+# A macro to prepend a given string onto the beginning of each string in a list\r
+MACRO(PREPEND _list _str)\r
+  SET(_temp_list ${${_list}})\r
+  SET(${_list})\r
+  FOREACH(x ${_temp_list})\r
+    SET(${_list} ${${_list}} ${_str}${x})\r
+  ENDFOREACH(x)\r
+ENDMACRO(PREPEND _list _str)