[CMake] [MISC] CMake support for enscript
Tristan Carel
tristan.carel at gmail.com
Thu Sep 21 15:04:17 EDT 2006
Hi CMake users,
Enscript (http://www.codento.com/people/mtr/genscript) is, I guess,
one of the most powerful pretty printing tool for code. It's used by
many other programs which need syntax highlightning. It can generate
nice documents in several format (ps, html, rtf...)
Enscript highlightning system does not support CMake source files in
the last version and Google told me anyone has written the required
file `cmake.st'.
So I made a very naive one which only identify:
- commands
- variables
- strings
You can find `CMakeLists.txt.pdf' in attachment for an example of the
document generated by enscript.
To install it:
copy the `cmake.st' (provided in attachment) in the
%INSTALL_DIR%/share/enscript/hl directory and patch the
`%INSTALL_DIR%/share/enscript/hl/enscript.st':
--- hl/enscript.st.orig 2006-09-21 10:58:24.000000000 +0200
+++ hl/enscript.st 2006-09-21 10:57:40.000000000 +0200
@@ -470,6 +470,7 @@
namerules
{
/\.(c|h)$/ c;
+ /\.cmake$/ cmake;
+ /CMakeLists.*/ cmake;
/\.(c++|C|H|cpp|cc|cxx)$/ cpp;
/\.m$/ matlab;
/\.(mpl|mp|maple)$/ maple;
like usual:
... ANY EXPRESS OR IMPLIED WARRANTIES, [...] IN NO EVENT SHALL THE
REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ... :)
Maybe this could be added to the CMake wiki.
The following does not concern CMake at all, my apologizes but I
believe it can be useful.
PS: To print code is sometimes useful when you're too tired to read on
a screen or when you need to step back to understand a piece of code.
You can easely make a pretty .pdf of your source code with the shell
script `ppcode' (in attachment). the `CMakeLists.txt.pdf' has been
generated with this script.
--
Tristan Carel
http://tristan-carel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake.st
Type: application/octet-stream
Size: 2559 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060921/674deec7/cmake.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeLists.txt.pdf
Type: application/pdf
Size: 3056 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060921/674deec7/CMakeLists.txt.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppcode
Type: application/octet-stream
Size: 1569 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060921/674deec7/ppcode.obj
More information about the CMake
mailing list