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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
...
The --trace option is helpful, but sometimes, what you're looking for is
deep under many layers of function calls and figuring out what instance
of the function call you're looking at is tedious to determine (usually
involving patching and message()). Instead, add a --trace-expand option
to trace while expanding commands into what CMake actually sees.
Since commit v2.4.0~4158 (When the initially configured generator is
invalid, allow the user to change the generator without deleting the cache
by hand, 2003-05-13) we remove CMAKE_GENERATOR from the cache if an error
occurs and CMAKE_MAKE_PROGRAM is not cached. This worked at the time
because all generators initialized the CMAKE_MAKE_PROGRAM cache entry.
Since commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM
lookup by generators, 2013-11-15) and commit v3.2.0-rc1~39^2 (Xcode:
Switch to internal CMAKE_MAKE_PROGRAM lookup by generator, 2015-01-28) the
VS and Xcode generators no longer store CMAKE_MAKE_PROGRAM in the cache.
Therefore any error during generation would wipe out CMAKE_GENERATOR from
the cache and cause the next configuration to choose a default generator.
Simply drop the behavior introduced by the original commit and always
preserve CMAKE_GENERATOR. Since the time that behavior was introduced a
lot more state is now saved in CMakeCache.txt and CMakeFiles/ during the
initial configuration so it is not safe to change generators without
starting fresh anyway.