Commit Graph

246 Commits

Author SHA1 Message Date
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 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 780bff5279 cmake: Store hardcoded lists of sources and headers
Don't duplicate this in each cmMakefile.
2015-10-27 07:44:22 +01: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 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 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
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
Ben Boeckel 594bafe527 cmake: add --trace-expand option
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.
2015-07-23 15:33:10 -04:00
Stephen Kelly 353e422b2a cmMakefile: Remove unused GetPolicies method. 2015-06-06 09:35:55 +02:00
Stephen Kelly 52919ac8ac cmMakefile: Make cmListFileBacktrace default constructible. 2015-06-03 01:03:59 +02:00
Stephen Kelly 01e1cd5c1f cmState: Move snapshot creation to the cmake instance.
Don't create a snapshot in Initialize(), but leave the creation
responsibility to the cmake instance instead.  Previously, the
cmState would Initialize() in its constructor, and the cmake instance
would re-Initialize() during Configure().  The end result was the
same and there would be one snapshot present.  However, cmLocalGenerator
also created a snapshot on construction, and that one was used, leaving
the first snapshot unused, and potential for off-by-one errors.

Fix that by making the cmLocalGenerator use the existing snapshot
if it is top-level.  Add a CurrentSnapshot to the cmake instance and
populated it while configuring a directory.  This will eventually
replace the 'current local generator' concept.  Fix the GetParent
implementation to be able to return the first snapshot.
2015-05-24 13:30:24 +02:00
Stephen Kelly 4fdad392b6 cmake: Remove redundant forward declaration.
The appropriate include is already here.
2015-05-24 12:56:09 +02:00
Stephen Kelly 8b4b9631f5 cmake: Add IssueMessage overload taking a single cmListFileContext.
Port appropriate clients to use it.
2015-05-22 01:21:35 +02:00
Stephen Kelly ca7cc2ebd0 cmake: Extract PrintMessagePreamble method. 2015-05-22 00:54:26 +02:00
Brad King b0ea367308 Help: Spell '-D' option consistently across documentation (#15575)
Always show the option with its argument separate in summary text.
State in the main documentation that the option and its argument can be
given together too.
2015-05-20 08:30:36 -04:00
Stephen Kelly ae6c8a9d68 cmState: Store the Source and Binary directories. 2015-04-28 07:50:57 +02:00
Stephen Kelly b23cf06f86 cmake: Remove redundant start directories.
They are maintained as containing the same content as the 'home'
directories, but they are never read from.

Fix some comments and help strings which confused the two by
name. They actually mean what is called CMAKE_SOURCE_DIR in
cmake code.
2015-04-21 00:12:51 +02:00
Stephen Kelly 9b5f80a83c Move global properties to cmState. 2015-04-15 11:43:50 -04:00
Stephen Kelly 0076b5d834 cmake: Remove the happy global property scope pattern.
Global properties are already global in scope, so remove the
overload for specifying it and port users of the API.

The call from cmMakefile::GetProperty can be simplified because
the scope is only used during chaining, and there is no further
chaining after processing global properties.
2015-04-15 11:43:50 -04:00
Stephen Kelly 24b7f31d3a cmake: Remove unused cmCommand methods. 2015-04-15 11:43:50 -04:00
Stephen Kelly 96f8c5f9a3 cmState: Move cmCommand-related methods from cmake class. 2015-04-13 21:12:14 +02:00
Stephen Kelly 1e738bcf9c cmake: Simplify RemoveUnscriptableCommands algorithm.
Remove obsolete RemoveCommand method.
2015-04-13 21:10:19 +02:00
Stephen Kelly b159bff732 Move property definition to cmState. 2015-04-13 20:13:13 +02:00
Brad King 62c5e6f1a1 Merge topic 'introduce-cmState'
f081c5bd cmState: Move CacheEntryType enum from cmCacheManager.
f71fdf0e cmMakefile: Remove unused CacheManager accessor.
ff7169a0 Port to cmState.
a6b1ad13 Introduce cmState class.
2015-04-13 11:45:02 -04:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Stephen Kelly a6b1ad1309 Introduce cmState class.
At this point, it is an interface to the cache.  It will be extended
to be a universal interface for access to and manipulation of
configuration-time data (defintions, properties on targets,
directories, source files etc).

This will allow porting all command implementations away
from the cmMakefile and cmTarget classes, and result in something
more-purely related to configuration-time processing of cmake
commands.  That should serve at least the following goals:

 * Split the CMake implementation more definitively into three
   stages: Configuration, computation and generation, and be able to
   implement each optimally for memory access patterns etc.
 * Make better IDE integration possible by making more configuration
   data available.
 * Make it possiblte to use a smaller library than CMakeLib.a in
   cpack and ctest, resulting in smaller executables.
 * Make it possible to run the configure step multiple times in
   the same CMake run (#14539).

Manage its lifetime in the cmake class, and add a convenience accessor
to cmMakefile.
2015-04-13 11:44:14 -04:00
Brad King 92d6179893 Merge topic 'cmake-cleanups'
07d44d63 cmake: Remove confusing duplication.
ea819b29 cmMakefile: Remove unused method.
6ad86c7f cmMakefile: Remove bad comment.
fca2b542 cmMakefile: Internalize setting of CMakeInstance on Properties.
7bb4e3db cmMakefile: Out-of-line Home directory accessors.
6241253a cmake: Out-of-line Home and Start directory methods.
0ee3ccb3 cmake: Fix variable name bugs.
57dd094e Use vector, not list for cmCommand storage.
6deb43e6 Remove some files which do not need to be in BootstrapCommands.
ecdb1b3b Add some missing includes.
04b307b9 cmake: Simplify CommandExists method.
0f1f324b cmake: Rename oddly named variables.
275185ac cmake: Constify GetCommand method.
c57f086a cmake: Don't lower-case a string needlessly.
23368c9b cmake: Use make_pair instead of Foo::value_type.
14c70b8c cmake: out-of-line try compile state methods.
...
2015-04-13 11:38:20 -04:00
Stephen Kelly 6241253a4b cmake: Out-of-line Home and Start directory methods. 2015-04-12 23:10:44 +02:00
Stephen Kelly 0ee3ccb3b0 cmake: Fix variable name bugs. 2015-04-12 23:10:44 +02:00
Stephen Kelly 275185ac2b cmake: Constify GetCommand method. 2015-04-12 20:08:49 +02:00
Stephen Kelly 14c70b8c58 cmake: out-of-line try compile state methods. 2015-04-12 20:08:48 +02:00
Stephen Kelly ade20b433b cmake: Remove DebugConfigs member.
It adds needless complexity to global property handling.
2015-04-12 20:08:47 +02:00
Stephen Kelly 7450a2c6ed cmake: Remove method with no external users.
Port internal users to access the member.
2015-04-12 20:08:46 +02:00
Gerald Combs 588dcb33b7 cmake: Provide guidance when an invalid -G option is given
Print a list of generators if no generator or an invalid one is
supplied.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
2015-04-10 15:14:34 -04:00
Stephen Kelly 14973054a2 Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-07 23:25:39 +02:00
Brad King 3347c5e4f9 Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits.  The
GetCacheEntryValue API returns a pointer to memory freed on return.
It will have to be revised along with the rest of the original topic.
2015-04-07 17:15:04 -04:00
Stephen Kelly 1fe7f24c2b Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-06 17:58:55 +02:00
Stephen Kelly 364c7ea187 cmake: Remove unused method. 2015-04-05 10:26:09 +02:00
Stephen Kelly 47acfe1d1e cmake: Remove unused member. 2015-04-05 10:10:00 +02:00
Brad King eb7d815649 cmake: Add -A option to specify a generator platform
Define the 'cmake -A' option to set CMAKE_GENERATOR_PLATFORM
without having to spell out the whole variable name.  We choose
the name '-A' for "platform" because '-P' is already taken, and
in the common use case the "platform" is actually an architecture
(e.g. x64).

Teach the RunCMake test infrastructure to use -A to pass the generator
platform.  Extend the RunCMake.GeneratorPlatform test with a case to
verify that the -A option cannot be repeated.
2014-09-15 10:26:59 -04:00
Brad King 0f1f1271e6 CMake: Add CMAKE_GENERATOR_PLATFORM option
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_PLATFORM and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorPlatform test to cover basic use cases for the
option.  Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and
that it is rejected when the generator does not support a user setting.
2014-09-05 14:38:05 -04:00
Ben Boeckel 2a1b2d8486 backtrace: Convert to local paths in IssueMessage
This is the only place we care show the FilePath to the user, so defer
the expensive relative path calculation until here.
2014-06-05 12:44:19 -04:00
Ben Boeckel efc205695d cmake: remove dummy backtraces for IssueMessage 2014-06-05 12:44:17 -04:00