On Fri, Jan 31, 2014 at 2:01 AM, Rob McDonald <rob.a.mcdon...@gmail.com> wrote:
> All,
>
> I'm interested in adding a code beautifier to my project.  I'm looking at
> AStyle, but am open to others.
>
> Implementing a FindAStyle.cmake is pretty trivial.  Likewise, implementing
> custom targets is pretty straightforward in the simple case.
>
> However, I thought there might be some canonical/idiomatic examples of this
> sort of thing.  Any pointers to projects that do this particularly well?
> Are there any other code beautifiers that already have CMake support?

I don't know of any "canonical" way of doing this - it's going to
pretty similar to targets that run doxygen or otherwise trigger custom
action, assuming the idea is to have "make astyle-format" or something
similar that runs astyle on all your source files.

BRL-CAD has implemented (working but not yet activated for default
use) an integration of astyle that makes incorrect styling of source
code files a compile-time error when building the system.  It's both
more elaborate and more invasive than a "run astyle" build target, but
does compel developers to take styling rules seriously.  Sort of like
"-Werror" for code formatting.  There's also the option of "print
noisy warnings but keep building" for a less draconian approach that's
still hard to ignore.

Cheers,
CY
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to