ruphy / oxy-cursors

Oxygen cursors. With Oxygen love.
http://blog.ruphy.org/
GNU General Public License v3.0
18 stars 7 forks source link

make fails with 'Macro invoked with incorrect arguments for macro named: adjust' #1

Open AlexCzar opened 10 years ago

AlexCzar commented 10 years ago

Command that fails:

/usr/bin/cmake
 -Dconfig=/path/to/oxy-cursors/src/config/a2a266d0498c3104214a47bd64ab0fc8.in
 -Doutput=/path/to/oxy-cursors/build/oxy-brown/config/a2a266d0498c3104214a47bd64ab0fc8.in
 -Ddpi=90 -P /home/czar/Downloads/oxy-cursors/src/make_config.cmake

Failure message:

CMake Error at /path/to/oxy-cursors/src/make_config.cmake:15 (adjust):
  adjust Macro invoked with incorrect arguments for macro named: adjust

Full log: https://gist.github.com/AlexCzar/4da20640193be0c80c06

Software versions used:

GNU Make 3.82
cmake version 2.8.11.2
Inkscape 0.48.4 r9939
Chocimier commented 5 years ago
diff --git a/src/make_config.cmake b/src/make_config.cmake
index 564601e..816f597 100644
--- a/src/make_config.cmake
+++ b/src/make_config.cmake
@@ -11,8 +11,12 @@ file(READ "${config}" in_contents)
 set(out_contents)
 string(REPLACE "\n" ";" in_contents "${in_contents}")
 foreach(in_line ${in_contents})
-   string(REGEX REPLACE "[ \t]+" ";" in_line "${in_line}")
-   adjust(${in_line})
+   if(in_line MATCHES "#.*")
+      list(APPEND out_contents "${in_line}")
+   else()
+      string(REGEX REPLACE "[ \t]+" ";" in_line "${in_line}")
+      adjust(${in_line})
+   endif()
 endforeach(in_line)
 string(REPLACE ";" "\n" out_contents "${out_contents}")
 file(WRITE "${output}" "${out_contents}\n")