Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Игорь Пашев
Code formatting is completely out of scope of building system.
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Alan W. Irwin

On 2014-01-31 13:55+0400 Игорь Пашев wrote:


Code formatting is completely out of scope of building system.


I disagree with your attempt to shut off discussion.

Some projects don't use code styling, others run a script
aperiodically to clean up the code (PLplot uses uncrustify that way).
Both of those cases are out of CMake scope, but I am also sure that
some projects (like is clear with the OP) prefer code styling to be
under CMake control.  So my own opinion is that topic is certainly a
legitimate one here.

And to answer the OP's question, I can highly recommend uncrustify for
code styling, but to my knowledge there is no CMake support for
uncrustify (yet).

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

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

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Clifford Yapp
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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Paul Smith
On Fri, 2014-01-31 at 02:26 -0800, Alan W. Irwin wrote:
 And to answer the OP's question, I can highly recommend uncrustify for
 code styling

I agree with Alan.  We did a huge reformatting effort last year to
change a very large C++ codebase from a style based loosely on
Whitesmith to a more common style.  I started with AStyle which is a
solid program, but it has limited customization support.

Then I found uncrustify and was quite satisfied with it.  I sent a few
patches for minor fixes and they were well received.  The main issue
with uncrustify is that the documentation could be better: for some of
the more advanced settings it's very hard to understand exactly what
they control.

I had to do a bit of scripting around it since uncrustify didn't handle
all the whitespace conversion we wanted, but it worked great!

We didn't try to integrate it with the build system.  We just checked in
the configuration file and a script people could use if they wanted to
re-beautify their code.

-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Eric Noulard
2014-01-31 Paul Smith p...@mad-scientist.net:


 I had to do a bit of scripting around it since uncrustify didn't handle
 all the whitespace conversion we wanted, but it worked great!

 We didn't try to integrate it with the build system.  We just checked in
 the configuration file and a script people could use if they wanted to
 re-beautify their code.

Would you mind sharing the script you used with us?


-- 
Erk - L'élection n'est pas la démocratie -- http://www.le-message.org
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Marcel Loose
On 31/01/14 14:11, Paul Smith wrote:
 On Fri, 2014-01-31 at 02:26 -0800, Alan W. Irwin wrote:
 And to answer the OP's question, I can highly recommend uncrustify for
 code styling
 I agree with Alan.  We did a huge reformatting effort last year to
 change a very large C++ codebase from a style based loosely on
 Whitesmith to a more common style.  I started with AStyle which is a
 solid program, but it has limited customization support.

 Then I found uncrustify and was quite satisfied with it.  I sent a few
 patches for minor fixes and they were well received.  The main issue
 with uncrustify is that the documentation could be better: for some of
 the more advanced settings it's very hard to understand exactly what
 they control.
That's why I like universalindentgui, a standard Ubuntu package. You can
immediately see what changes will be made to the code when you fiddle
with one of the many settings in uncrustify (assuming it has effect on
the source file you're viewing).

 I had to do a bit of scripting around it since uncrustify didn't handle
 all the whitespace conversion we wanted, but it worked great!

 We didn't try to integrate it with the build system.  We just checked in
 the configuration file and a script people could use if they wanted to
 re-beautify their code.


attachment: loose.vcf-- 

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

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Leif Walsh
What would be a good way to run a tool like this just before compiling? My 
naive solution is going to be to add a custom command to run it and touch a 
stamp, a target to run that custom command, and then make every single target 
in my project depend on that custom target. Is there a less invasive way to do 
this in cmake?

Sent from my iPhone

 On Jan 31, 2014, at 9:06, Marcel Loose lo...@astron.nl wrote:
 
 On 31/01/14 14:11, Paul Smith wrote:
 On Fri, 2014-01-31 at 02:26 -0800, Alan W. Irwin wrote:
 And to answer the OP's question, I can highly recommend uncrustify for
 code styling
 I agree with Alan.  We did a huge reformatting effort last year to
 change a very large C++ codebase from a style based loosely on
 Whitesmith to a more common style.  I started with AStyle which is a
 solid program, but it has limited customization support.
 
 Then I found uncrustify and was quite satisfied with it.  I sent a few
 patches for minor fixes and they were well received.  The main issue
 with uncrustify is that the documentation could be better: for some of
 the more advanced settings it's very hard to understand exactly what
 they control.
 That's why I like universalindentgui, a standard Ubuntu package. You can
 immediately see what changes will be made to the code when you fiddle
 with one of the many settings in uncrustify (assuming it has effect on
 the source file you're viewing).
 
 I had to do a bit of scripting around it since uncrustify didn't handle
 all the whitespace conversion we wanted, but it worked great!
 
 We didn't try to integrate it with the build system.  We just checked in
 the configuration file and a script people could use if they wanted to
 re-beautify their code.
 
 loose.vcf
 -- 
 
 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
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Игорь Пашев
2014-01-31 Leif Walsh leif.wa...@gmail.com:
 What would be a good way to run a tool like this just before compiling?

I'd prefer running such a tool *after* compiling.

If you have a syntax error, your sources can be ruinned.
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Miller Henry
I'll second (third) the vote for uncrustify over astyle.  Astyle doesn't have 
enough options to take care of all style issues, with uncrustify you can 
configure everything.  Also check out clang-format - it only supports 3 styles 
(last I checked), but if one of them fit it might be easiest.

What works well for us is a custom script that ties into our version control, 
and code review tool.  Since everyone is using this script to upload code 
reviews they get for free uncrustify run on changed files, and cppcheck (you 
are a fool not to use this as a minimum requirements things in my opinion) is 
also run on all code.  This script is of course tied very closely to our 
development process and servers and so it isn't worth sharing.  However it is 
easy to write something similar for your processes, and seems like a better 
course of action.  Once a file is uncrustifed it doesn't need to be checked on 
everyone's build again.  You just need to ensure the tool is run before the 
code reaches version control.   

On the same lines most source control systems allow you to write a pre checkin 
hook.

While it is possible to do the work in cmake, I don't think it is the right 
approach.

-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Paul Smith
Sent: Friday, January 31, 2014 7:12 AM
To: Alan W. Irwin
Cc: CMake ML
Subject: Re: [CMake] AStyle or similar code beautifier

On Fri, 2014-01-31 at 02:26 -0800, Alan W. Irwin wrote:
 And to answer the OP's question, I can highly recommend uncrustify for 
 code styling

I agree with Alan.  We did a huge reformatting effort last year to change a 
very large C++ codebase from a style based loosely on Whitesmith to a more 
common style.  I started with AStyle which is a solid program, but it has 
limited customization support.

Then I found uncrustify and was quite satisfied with it.  I sent a few patches 
for minor fixes and they were well received.  The main issue with uncrustify is 
that the documentation could be better: for some of the more advanced settings 
it's very hard to understand exactly what they control.

I had to do a bit of scripting around it since uncrustify didn't handle all the 
whitespace conversion we wanted, but it worked great!

We didn't try to integrate it with the build system.  We just checked in the 
configuration file and a script people could use if they wanted to re-beautify 
their code.

-- 

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
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Matthew Woehlke

On 2014-01-31 02:01, Rob McDonald wrote:

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?


By CMake support, do you mean that can beautify CMake script? Or that 
have an existing find module? (For a program like this I'm not sure I'd 
bother with a find module; often, find_program is all you really need.)


As far as recommended C/C++ beautifiers, these days you might want to 
look at clang-format... parsing C++ is getting harder and harder with 
C++11 and later; as such it stands to reason that a tool that is backed 
by a well maintained, full-blown C++ parser is likely to be beneficial.


I do use astyle for some of my own projects, but I've found that I have 
to do a non-trivial amount of additional pre- and post-processing to get 
good results.


--
Matthew

--

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Gregoire Aujay
Hello, 

I use astyle in my projects but it is not related to build (not a target). I 
have a cmake script that I launch using cmake -P so I don't have to write too 
much .bat or .sh scripts.
This script has the following options (using -D command line parameters):
- folder where to recursively find the sources to be beautified
- whether or not to run the tool inplace or copy files to another 
directory first so I can do a diff between before and after

Regards,
Gregoire


-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of ? ?
Sent: vendredi 31 janvier 2014 16:54
To: Leif Walsh
Cc: cmake@cmake.org
Subject: Re: [CMake] AStyle or similar code beautifier

2014-01-31 Leif Walsh leif.wa...@gmail.com:
 What would be a good way to run a tool like this just before compiling?

I'd prefer running such a tool *after* compiling.

If you have a syntax error, your sources can be ruinned.
-- 

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
-- 

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Rob McDonald
Thanks to everyone for all the helpful responses.  It looks like most of
the ideas were pretty similar to what I was thinking.  Glad to know I
wasn't missing anything huge.

I had found UniversalIndentGUI and plan on using it.  I had also found
uncrustify and will take a closer look at it.


On Fri, Jan 31, 2014 at 1:55 AM, Игорь Пашев pashev.i...@gmail.com wrote:

 Code formatting is completely out of scope of building system.



I think that CMake has historically trended towards an expansionist view of
what it can/should be used for, not a restrictionist one.  I think a lot of
the other posters make good cases for why this may be a good idea.

In general, I think of CMake as a tool that helps to standardize working
with code.  That can be cross platform builds, support for build farms and
unit testing, automatic documentation generation, packaging of the project,
etc.

I want to clean up a large codebase with years of formatting neglect in an
automated way.  AStyle or Uncrustify are the right tool for this.  I would
like to give my team an easy way to check the formatting against the same
style.  Including a config file or the full command line with options is a
good tool for this.  My team works on different platforms, so a
FindAStyle.cmake which just uses Find_Program and CMake's cross platform
scripting are good solutions to make this easy.  Including format checking
or reformatting as build targets increase the probability that my team will
use these tools.  With CMake, those build targets show up for my team, no
matter whether they use Make, Visual Studio, Eclipse, etc.

If our project someday graduates to a more advanced level, then the kind of
integration that BRL-CAD uses with automatic format checks with warnings on
every build could be a good step -- and CMake would be a good tool to help
make that happen.

Rob
-- 

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

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Alan W. Irwin

On 2014-01-31 14:24+0100 Eric Noulard wrote:


Would you mind sharing the script you used with us?


Although that question was directed to someone else, you might be
interested in scripts/style_source.sh within the PLplot source code.

There are options to show diffs (or not) and apply the changes shown
by those diffs or not.  There is also some sed processing used so that
uncrustify can style *.i files (Swig configuration files). There is an
addition a further (python) script called by scripts/style_source.sh
that enforces the C++ (//) style of commenting on C code (which
we prefer).

The scripts/style_source.sh script and the sed and python scripts it
uses (in addition to uncrustify) are now reliable enough that I
normally just use the --apply option.

Returning back to the original topic, if someone did decide to
implement full-blown CMake support for code styling, then one obvious
possibility is to use properties (specified for any of directory
source or target) to control styling.

Here are my thoughts on the properties required based on
my experience with the above script.

You would need support for multiple STYLE_COMMAND properties (similar
to execute_process COMMAND's) to identify the series of commands that
are used (typically in a pipeline which is why I mentioned
excecute_process) for styling a file.

You would need properties to support what to do with the style
checker results, e.g., warn or error out if style does not conform,
show diffs, or apply.

CMake support for Swig support would likely have to be changed to
allow styling properties to apply to the *.i files.

In my view it would also be essential to have some overall CMake
variable (which defaults to OFF) concerning whether to use the styling
properties that are specified by the build system.  Most users won't
have the code styling tools (e.g., a specific version of uncrustify
like we use in our case) installed, and even project developers would
not want to check style every time they did a build since that would
noticeably add to build times.  Of course, this is just a convenience
variable, but in its absence each project that uses styling tools
would have to implement conditional CMake code at each place where
style options were used. So I classify this convenience option as
essential.

One advantage of integrating styling support into CMake in the way I
have outlined is there would be just one tool where source code needs
to be identified (i.e., CMake) rather than two (i.e., CMake and some
external script).  Even though finding source code is pretty
straightforward with a shell script that uses file globbing, I still
feel that advantage of a CMake implementation is worth having so I
would likely abandon my script and move to using CMake for styling if
support for such styling includes the capabilities I have mentioned
above.  And obviously such an implementation of CMake support for code
styling would appeal even more to those interesting in styling their
code but who have not yet written a script to do that.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

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


Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Paul Smith
On Fri, 2014-01-31 at 14:24 +0100, Eric Noulard wrote:
  We didn't try to integrate it with the build system.  We just checked in
  the configuration file and a script people could use if they wanted to
  re-beautify their code.
 
 Would you mind sharing the script you used with us?

Sure, it's pretty simple.  Works on Linux and Mac.  Windows users have
to fend for themselves :-).

In addition to standard uncrustify, this converts all TABs to the
appropriate number of spaces (uncrustify doesn't mess with stuff inside
comments for example) and it removes all trialing whitespace.

This doesn't make any backup files; it's assumed you're using a source
control system and you've committed a copy beforehand (because it was
written for a one-time reformat originally) but if you want to keep
the .orig file for safety, just don't delete it.



reformat.sh
Description: application/shellscript
-- 

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

Re: [CMake] AStyle or similar code beautifier

2014-01-31 Thread Eric Noulard
2014-01-31 Paul Smith p...@mad-scientist.net:
 On Fri, 2014-01-31 at 14:24 +0100, Eric Noulard wrote:
  We didn't try to integrate it with the build system.  We just checked in
  the configuration file and a script people could use if they wanted to
  re-beautify their code.

 Would you mind sharing the script you used with us?

 Sure, it's pretty simple.  Works on Linux and Mac.  Windows users have
 to fend for themselves :-).

Thanks.
Thanks to Alan as well for the similar file in PLplot.



-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org
-- 

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


[CMake] AStyle or similar code beautifier

2014-01-30 Thread Rob McDonald
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?

Thanks,

Rob
-- 

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