Commit Graph

799 Commits

Author SHA1 Message Date
Brad King be14fe4857 Source: Stabilize include order of sys/types.h before sys/stat.h
Include the two headers in an isolated block with a comment separating
them so that tools that re-order includes do not re-order these.
2016-05-03 10:08:41 -04:00
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
Brad King 0f96ef00cb Remove unused cmake::IssueMessage overload
All callers now pass a full backtrace so we do not need the alternative
that takes a cmListFileContext directly.  Drop this overload to remove
the code duplication.
2016-04-18 09:21:19 -04:00
Brad King 3144857e1e Avoid depending on CMAKE_ROOT cache entry internally (#16015)
Use cmSystemTools::GetCMakeRoot() which always knows the location of our
resources.  Do not depend on CMAKE_ROOT because the user could unset it
from the cache.
2016-03-16 09:03:26 -04:00
Brad King f47b4f68a9 Drop Visual Studio 7 generator for VS .NET 2002
This generator has been deprecated since CMake 3.3.  Remove it.
2016-03-11 08:53:50 -05:00
Brad King b42866a34a Drop Visual Studio 6 generator
This generator has been deprecated since CMake 3.3.  Remove it.
Update documentation, modules, and tests to drop content specific
to this generator.
2016-03-09 09:42:18 -05:00
Michael Scott 28f2d750ed Add -Werror and -Wno-error command-line options
Expand the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and
downgrading warning and error messages. Implement support for these new
formats for the dev and deprecated message types.

Add tests and updated documentation for new options.
2016-01-12 14:02:51 -05:00
Michael Scott 291275347b cmake: Deduplicate warning message control code
Remove the duplicate code in cmake::Configure to set the cache variables
for the warning message suppression.  Replace it with calls to the
dedicated methods to carry this out.
2015-12-10 09:28:31 -05:00
Michael Scott 67211011d9 cmake-gui: Add options to control warning messages
Create a new dialog window for the cmake-gui that provides controls for
setting the state of suppression of developer and deprecated warning
messages.  This replaces the previous single checkbox for setting the
state of suppression of developer warnings.

Added a note for the new functionality to the release notes.
2015-12-10 09:28:31 -05:00
Michael Scott aac633d5e5 Explicitly enable deprecated warnings by default.
Explicitly enable deprecated warnings by default, via the
cmake::GetSuppressDeprecatedWarnings method, which signals
suppression is turned off unless the CMake variables are set
as required.

Add tests and update the documentation for the new
functionality.
2015-12-01 10:22:51 -05:00
Michael Scott e8974b62d7 Modify dev warning options to affect deprecated warnings.
Change the '-Wdev' and '-Wno-dev' options to also enable and
suppress the deprecated warnings output, via the
'CMAKE_WARN_DEPRECATED' CMake variable, by default. This
action does not happen if the user specifies a deprecated
warning message option.

Add tests and update the documentation for the new
functionality.
2015-12-01 10:22:45 -05:00
Michael Scott da688bcb3b Add -W options to control deprecated warning messages.
Add 'deprecated' warning options type, to allow setting
CMAKE_WARN_DEPRECATED via the -W '-Wdeprecated' and
'-Wno-deprecated' options.

Add tests for new options and updated documentation.
2015-12-01 10:21:57 -05:00
Michael Scott 07388f83b6 Refactor the -W options parser to be generic.
Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.
2015-12-01 09:40:43 -05:00
Michael Scott 246b0bfbfd Explicitly enable author (dev) warnings by default.
Explicitly enable author warnings by default, via the
cmake::GetSuppressDevWarnings method, which signals suppression
is turned off unless the CMake variables are set as required.

Add test cases for author and deprecated messages displayed by
default.
2015-12-01 09:35:53 -05:00
Michael Scott deec3a3f06 Make message suppression more consistent.
Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
2015-11-30 15:00:08 -05:00
Robert Dailey 2b958a2027 cmake-gui: Add option to specify generator toolset
The -T parameter to CMake may now be specified through cmake-gui via a
new text field in the first-time configure wizard (below the generator
chooser).

The generator factories specify whether or not they support toolsets.
This information is propagated to the Qt code and used to determine if
the selected generator should also display the optional Toolset widgets.
2015-11-17 10:03:10 -05:00
Stephen Kelly b6278e9ff7 cmake: Port find_package mode away from GetGeneratorTarget 2015-10-27 07:44:26 +01:00
Stephen Kelly 780bff5279 cmake: Store hardcoded lists of sources and headers
Don't duplicate this in each cmMakefile.
2015-10-27 07:44:22 +01:00
Stephen Kelly 482b3811e4 cmTarget: Move link type enum out.
Remove a reason for generate time code to depend on the cmTarget header/type.
2015-10-15 00:41:22 +02:00
Stephen Kelly 20b95ef8c8 cmState: Initialize default definitions immediately.
Don't leave this as cmMakefile responsibility.
2015-10-14 00:16:20 +02:00
Stephen Kelly 2c219bafc0 cmState: Initialize top level source directories immediately.
Don't leave this as cmMakefile responsibility.
2015-10-14 00:16:07 +02:00
Stephen Kelly 79a309d786 cmState: Port away from cmake instance. 2015-10-10 15:42:02 +02:00
Stephen Kelly e2eecae205 cmState: Move ParseCacheEntry from cmCacheManager. 2015-10-10 15:36:59 +02:00
Stephen Kelly 95b0d761a7 cmState: Externalize logic to caller. 2015-10-10 15:36:58 +02:00
Stephen Kelly 435a2f3ccb cmCacheManager: Port away from cmake instance. 2015-10-10 15:36:58 +02:00
Stephen Kelly 062ed22ec4 cmState: Add cache file manipulation wrappers. 2015-10-10 15:36:58 +02:00
Stephen Kelly a02e53eb94 Inline unary LoadCache. 2015-10-10 15:36:57 +02:00
Stephen Kelly 2afadb0d5a cmake: Port away from trivial cmCacheManager use. 2015-10-10 15:10:23 +02:00
Stephen Kelly 3d8c299f3e cmake: Use existing cache API wrapper. 2015-10-10 14:56:44 +02:00
Stephen Kelly 360e4e1db0 Set the current dirs on the snapshot before creating the cmMakefile.
The cmMakefile should get a fully prepared snapshot and not clobber its
definitions.  It should eventually be able to process list files from any
starting-point snapshot, though that is some refactoring away still.
2015-10-07 20:19:41 +02:00
Stephen Kelly 0a73044579 cmake: Remove needless cmLocalGenerator creation. 2015-10-05 20:52:26 +02:00
Brad King 414cc18a9a Merge topic 'revert-cmake-W-options'
2e606306 Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
81739e92 Revert topic 'cmake-W-options' (#15747)
2015-09-25 16:16:17 -04:00
Brad King 2e6063068c Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
Resolve conflicts in

 Help/variable/CMAKE_ERROR_DEPRECATED.rst
 Help/variable/CMAKE_WARN_DEPRECATED.rst

by integrating changes from both sides.
2015-09-22 13:57:08 -04:00
Brad King 81739e9215 Revert topic 'cmake-W-options' (#15747)
The changes in commit c96fe0b4 (cmake: Add -W options to control
deprecation warnings and errors, 2015-07-28) fail to account for
-Wdev warnings produced by places in CMake other than message().
This causes a regression in which -Wno-dev fails to suppress such
warnings.  Revert the feature until it can be revised accordingly.
2015-09-22 13:53:09 -04:00
Stephen Kelly ff8ac8ee6a cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
2015-08-28 18:44:39 +02:00
Stephen Kelly 92041eec49 cmGlobalGenerator: Remove MakeLocalGenerator method.
Inline implementation to callers.
2015-08-28 18:44:38 +02:00
Stephen Kelly acb006229d cmGlobalGenerator: Require a snapshot to create a local generator. 2015-08-28 18:44:38 +02:00
Stephen Kelly d8a5714839 cmake: Remove unused cmPolicies member.
heaptrack showed a 1 byte allocation with the backtrace pointing
here, as is the case since commit v3.3.0-rc1~112^2~5 (cmPolicies:
Remove unused cmPolicy class., 2015-05-03)
2015-08-23 18:28:01 +02:00
Clinton Stimpson ba1065ab7b cmake: Add support for "--build ." in subdirectory (#15696) 2015-08-14 22:46:53 -06:00
Brad King 422d3f68de Merge topic 'bootstrap-no-ninja'
4e3c7725 bootstrap: Do not build Ninja generator
2015-08-11 08:47:12 -04:00
Brad King 4e3c7725d0 bootstrap: Do not build Ninja generator
The CMake bootstrap process uses Makefile generators so there is no
need to build the Ninja generators during bootstrap.
2015-08-10 13:26:52 -04:00
Stephen Kelly 3dd6f0a5bc cmake: Port configure-time code to cmMakefile. 2015-08-07 04:10:28 +02:00
Brad King 4a1173fda0 Merge topic 'cmake-W-options'
975426ce cmake: Do not treat developer warnings as errors by default in scripts
2015-08-04 09:15:08 -04:00
Brad King 975426ceb3 cmake: Do not treat developer warnings as errors by default in scripts
The logic in commit c96fe0b4 (cmake: Add -W options to control
deprecation warnings and errors, 2015-07-28) accidentally enables
errors on warnings by default in scripts because there is no
initialization of CMAKE_SUPPRESS_DEVELOPER_ERRORS to TRUE.

Rename internal CMAKE_SUPPRESS_DEVELOPER_ERRORS cache entry to
CMAKE_ERROR_DEVELOPER_WARNINGS.  Fix the logic in the message() command
to treat AUTHOR_WARNING as an error only if the option is explicitly
enabled.
2015-08-03 10:03:27 -04:00
Brad King 609e8b181a Merge topic 'cmake-W-options'
c96fe0b4 cmake: Add -W options to control deprecation warnings and errors
2015-07-31 09:21:47 -04:00
Stephen Kelly fb9355c50e cmGlobalGenerator: Return from Compute whether to generate. 2015-07-29 10:43:33 -04:00
Stephen Kelly 29e8b7bfcc cmGlobalGenerator: Create a new Compute step before generation.
Replace the DoGenerate method.
2015-07-29 10:43:33 -04:00
Michael Scott c96fe0b40d cmake: Add -W options to control deprecation warnings and errors
Refactor the -Wdev and -Wno-dev to use a generic -W parser that follows
the GCC pattern.  Include support for setting CMAKE_ERROR_DEPRECATED and
CMAKE_WARN_DEPRECATED via the deprecated warning.  Add -Werror=dev and
-Wno-error=dev options so that dev warning options are in line with
deprecated warning options.  Use a new CMAKE_SUPPRESS_DEVELOPER_ERRORS
internal cache entry to store the above new dev options persistently.
Add tests for new options and updated cmake documentation and release
notes to list new options.
2015-07-29 09:20:10 -04:00
Brad King 98d6e9ec2d Merge topic 'use-generator-target'
57f03e59 Port some of the cmExportFileGenerator API to cmGeneratorTarget.
57ab0f70 Port cmExportBuildFileGenerator to cmGeneratorTarget.
570938cb cmExportTryCompileFileGenerator: Create cmGeneratorTargets.
ec38e4c8 Move GetFullPath to cmGeneratorTarget
dfb025bf Move GetLocationForBuild to cmGeneratorTarget.
9f2dca80 Move GetLocation to cmGeneratorTarget.
c7a8e74b Always access target location from a cmGeneratorTarget instance.
5b60eaf6 cmTarget: Restore the ImportedGetLocation method.
50b17a61 cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path.
ba266858 cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION.
5ab3a946 cmTarget: Inline GetLocation into deprecated callers.
496f4cd0 cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
de80993a cmGlobalGenerator: Create cmGeneratorTargets earlier.
611220f7 cmTarget: Use reliable test for CMP0024 and CMP0026 OLD.
bbad6ba5 cmLocalGenerator: Remove unused AddCustomCommandToCreateObject method.
e4dc83ad cmLocalGenerator: Remove unused AddBuildTargetRule method.
...
2015-07-28 10:08:50 -04:00