Commit Graph

16 Commits

Author SHA1 Message Date
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first).  First
run `clang-format` with the config file:

    ---
    SortIncludes: false
    ...

Commit the result temporarily.  Then run `clang-format` again with:

    ---
    SortIncludes: true
    IncludeCategories:
      - Regex:    'sys/types.h'
        Priority: -1
    ...

Commit the result temporarily.  Start a new branch and cherry-pick the
second commit.  Manually resolve conflicts to preserve indentation of
re-ordered includes.  This cleans up the include ordering without
changing any other style.

Use the following command to run `clang-format`:

    $ git ls-files -z -- \
        '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
      egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
      egrep -z -v '^Source/cm_sha2' |
      egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
      egrep -z -v '^Utilities/(KW|cm).*/' |
      egrep -z -v '^Tests/Module/GenerateExportHeader' |
      egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
      xargs -0 clang-format -i

This selects source files that do not come from a third-party.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Brad King 180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Stephen Kelly a0ebd69b52 Graphviz: Port to cmGeneratorTarget. 2015-10-24 09:19:55 +02:00
Stephen Kelly eac15298a8 cmState: Move TargetType enum from cmTarget.
Mostly automated:

 values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
 for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
2015-10-15 00:41:39 +02:00
Stephen Kelly 92b8b1fc3d cmGraphVizWriter: Re-arrange data layout.
Size goes from 272 to 264 bytes.
2015-06-07 10:24:26 +02:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Daniel Pfeifer 18bef4cd66 graphviz: allow to disable per target graphs (#14746)
In CMakeGraphVizOptions.cmake, allow the options GRAPHVIZ_GENERATE_PER_TARGET
and GRAPHVIZ_GENERATE_DEPENDERS to enable the generation of per target graphs
and subgraphs respectively. Both options are TRUE per default to maintain
current behavior.
2014-02-10 10:30:50 -05:00
Alex Neundorf 08fa5ddb1c Also generate dependers-graphviz files.
With this commit, the --graphviz option now also generates dot files
which show which other targets depend on some target.
So, now there is
* a global dot-file which shows all targets and dependencies
* a dot file which shows on what a target Foo depends
* a dot file which shows which other targets depend on Foo

Alex
2011-02-06 18:34:48 +01:00
Alex Neundorf 4f96a7621f GRAPHVIZ_IGNORE_TARGETS is now a list of regular expressions
This is similar e.g. to CTEST_CUSTOM_WARNING_EXCEPTION from ctest.
GRAPHVIZ_TARGET_IGNORE_REGEX is not supported anymore.
I hope this is ok, since this was 100% undocumented and can't
break a build.

Alex
2011-02-05 19:09:54 +01:00
Alex Neundorf 5698ad2047 Make it possible to exlude external libs from dot files
Patch from Christian Ehrlicher.
By setting GRAPHVIZ_EXTERNAL_LIBS to TRUE in CMakeGraphVizOptions.cmake
you can now exclude external libraries from the produced dot file.
I.e. then you see only the dependencies within your project.

Alex
2011-02-05 18:43:34 +01:00
Alex Neundorf 78c86f4542 Exclude targets from the graphviz file based on a regex
This commit adds support for a GRAPHVIZ_TARGET_IGNORE_REGEX variable
which can be set() in CMakeGraphVizOptions.cmake.
Targets matching this regex will be skipped when generating the graphviz
graphs.

Alex
2010-11-14 19:47:28 +01:00
Alex Neundorf 5ea1e4cb36 Collect targets and libs on demand instead of in the ctor
This is necessary for the next commit which requires that
the targets are collected after the settings have been read.

Alex
2010-11-14 19:37:03 +01:00
Alex Neundorf 2a5790a080 Use std::cout instead of fprintf
Alex
2010-11-14 19:33:12 +01:00
Alex Neundorf 7ba2d36585 Enable/disable generating graphs depending on the target type
In CMakeGraphVizOptions.cmake you can now set GRAPHVIZ_EXECUTABLES,
GRAPHVIZ_STATIC_LIBS, GRAPHVIZ_SHARED_LIBS and GRAPHVIZ_MODULE_LIBS
to TRUE or FALSE depending on whether you want graphs for the
targets of the respective types.

Alex
2010-11-14 19:30:58 +01:00
Alex Neundorf 84ce612c65 Move the code for generating dot-files into separate class cmGraphVizWriter
Alex
2010-11-09 21:37:51 +01:00