173 Commits

Author SHA1 Message Date
Brad King
60c06620a6 Merge topic 'cmoutputconverter-simplify'
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2831
2019-01-29 09:18:42 -05:00
Bruno Manganelli
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. 2019-01-27 15:48:57 +00:00
Brad King
5a6e683a32 Merge topic 'unixmfg3-string'
614876c638 cmLocalUnixMakefileGenerator3: more methods accept std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2840
2019-01-25 07:58:12 -05:00
Regina Pfeifer
5a0784ddea clang-tidy: Pass by value 2019-01-22 13:03:04 -05:00
Vitaly Stakhovsky
614876c638 cmLocalUnixMakefileGenerator3: more methods accept std::string 2019-01-22 11:11:13 -05:00
Vitaly Stakhovsky
2c50a72576 cmDepends: all members accept std::string arguments
Most `const char*` arguments converted to `const std::string&`
in `cmDepends` and derived classes.
In addition performed minor code cleanup.
2019-01-18 20:30:13 -05:00
Regina Pfeifer
b2aa3aedea clang-tidy: Use default member initialization 2018-12-15 10:52:37 +01:00
Regina Pfeifer
32cb564bea clang-tidy: Remove redundant member initializations 2018-12-15 10:51:47 +01:00
luz.paz
be28106880 Fix misc. typos
Found via `codespell` and `grep`
2018-06-04 10:32:49 -04:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Brad King
79f22e8408 Makefile,Ninja: De-duplicate ComputeObjectFilenames method
Move the method implementation up to `cmLocalCommonGenerator`
to avoid duplicating it in each generator.
2018-01-29 10:51:22 -05:00
Marc Chevrier
3f935e690a LocalGenerator: refactoring
Introduce method AppendCompileOptions to support
future source file property COMPILE_OPTIONS.
2018-01-23 10:24:47 +01:00
Brad King
0b33aee48b Use C++11 override instead of CM_OVERRIDE
We now require C++11 support including `override`.  Drop use of
the old compatibility macro.  Convert references as follows:

    git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' |
      xargs sed -i 's/CM_OVERRIDE/override/g'
2017-09-15 10:06:41 -04:00
Daniel Pfeifer
ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Stephen Kelly
1ed5f6b39b Makefiles: Introduce local RelativePath method
This makes it easier to remove directory-specific state from
cmOutputConverter where it doesn't belong.  Of course, this just
relocates the problem to the makefiles generator for now, but that's
better than affecting the core.
2016-10-06 20:02:08 +02:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Daniel Pfeifer
efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Stephen Kelly
51f7dcb0a5 Makefiles: Inline MakeLauncher into only caller 2016-08-27 15:21:24 +02:00
Stephen Kelly
112c87b28a Makefiles: Replace method with Wacom specific API
The existing method uses RelativeRoot NONE and FULL values.  In
principle, those should be segregated interfaces.  Mixing
NONE and FULL into the RelativeRoot enum is a case of

 http://thedailywtf.com/articles/What_Is_Truth_0x3f_
2016-08-27 15:16:50 +02:00
Stephen Kelly
c341f4679a Makefiles: Change AppendCustomCommand API to strings
Avoid the RelativeRoot enum.  Supply the HOME_OUTPUT string at each
callsite to make the parameter non-defaulted.
2016-08-27 13:44:53 +02:00
Stephen Kelly
6960516b6b Makefiles: Change signature of AppendCustomCommand
The RelativeRoot parameter will become non-default.
2016-08-27 13:44:52 +02:00
Stephen Kelly
e0fd2d0446 Makefiles: Port CreateCDCommand to string-based API 2016-08-27 13:44:52 +02:00
Daniel Pfeifer
1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Daniel Pfeifer
a7a9239096 mark functions with CM_OVERRIDE 2016-06-27 23:24:38 +02:00
Daniel Pfeifer
25d1ef6424 Use enums defined in cmOutputConverter using their fully qualified name.
Mostly automated:

values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT"
        "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE"
        "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree")
for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
2016-05-25 09:20:09 -04:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Stephen Kelly
4bc65d76f1 Makefiles: Port to cmGeneratorTarget. 2015-10-24 09:19:53 +02:00
Stephen Kelly
3df749af55 Remove vestigial declarations. 2015-10-21 00:19:57 +02:00
Stephen Kelly
3e8ef64273 cmLocalGenerator: Port some API to cmGeneratorTarget. 2015-10-17 17:30:38 +02:00
Stephen Kelly
7f5ec9f109 cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget. 2015-10-15 00:33:12 +02:00
Stephen Kelly
06f56d3bf5 cmLocalUnixMakefileGenerator3: Port AppendCleanCommand to cmGeneratorTarget. 2015-10-15 00:23:53 +02:00
Stephen Kelly
c8f8f16541 cmLocalUnixMakefileGenerator3: Port another API to cmGeneratorTarget. 2015-10-15 00:20:16 +02:00
Stephen Kelly
9f299a1225 cmLocalUnixMakefileGenerator3: Port API to cmGenertorTarget. 2015-10-15 00:11:21 +02: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
9b6a743b80 cmLocalGenerator: Remove Parent pointer. 2015-08-28 18:44:38 +02:00
Brad King
9d41f6d87b cmLocalCommonGenerator: Adopt ConfigName member
De-duplicate the member from the local Makefile and Ninja generators.
2015-07-09 09:50:06 -04:00
Brad King
a4a2518dd4 cmLocalUnixMakefileGenerator3: Provide GetConfigName() accessor
Rename internal member from ConfigurationName to ConfigName to
match the ninja generator.
2015-07-09 09:50:05 -04:00
Brad King
001f9b3617 Add common base classes to Makefile and Ninja generators
Provide a place to move functionality common to both.
2015-07-09 09:50:05 -04:00
Stephen Kelly
61c0113c13 cmLocalUnixMakefileGenerator3: Remove unused method. 2015-06-21 21:14:07 +02:00
Stephen Kelly
0efe4944e1 cmGlobalGenerator: Add ComputeHomeRelativeOutputPath method.
Fix generation of tgt/fast build targets.

Commit 363caa2f (cmLocalGenerator: De-virtualize Configure().,
2015-05-30) moved the computation of HomeRelativeOutputPath from
Configure-time to Generate-time, because it is only used at
Generate-time.  However, that commit caused the member for one
local generator to be computed immediately before generating with
that local generator, whereas previously the members of all local
generators were computed before generating any of them.

The HomeRelativeOutputPath is used by the GetRelativeTargetDirectory
method, which is called by the
cmGlobalUnixMakefileGenerator3::WriteConvenienceRules method.  That
method is called by the
cmLocalUnixMakefileGenerator3::WriteLocalMakefile method when generating
for the top-most (ie, the first) local generator.  At that point,
the HomeRelativeOutputPath is not yet computed.

Fix that by computing the member just before generating anything.
This will eventually be done in the cmLocalUnixMakefileGenerator3
constructor instead, but further refactoring is needed to make
that possible.
2015-06-13 08:38:27 +02:00
Stephen Kelly
3e087a408b cmLocalUnixMakefileGenerator: Re-arrange data layout.
Size goes from 536 to 528 bytes.
2015-06-07 09:32:38 +02:00
Stephen Kelly
363caa2fa5 cmLocalGenerator: De-virtualize Configure().
The generators that override it do so in order to populate
data members which can instead be populated in Generate().
2015-06-04 09:06:40 -04:00
Stephen Kelly
3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a
cmState::Snapshot.  Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent.  Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.

This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
2015-05-27 09:18:32 -04:00
Stephen Kelly
684e5cefb2 cmGlobalGenerator: Host the MakeSilentFlag. 2015-05-18 20:06:20 +02:00
Stephen Kelly
2047144f49 cmLocalGenerator: Remove unused IgnoreLibPrefix. 2015-05-18 20:06:20 +02:00
Stephen Kelly
333c1fa83b cmGlobalUnixMakefileGenerator3: Host the UnixCD. 2015-05-18 20:06:16 +02:00
Stephen Kelly
a97df5e135 cmGlobalUnixMakefileGenerator3: Host the PassMakeflags. 2015-05-18 20:03:49 +02:00
Stephen Kelly
cf7f03e522 cmGlobalUnixMakefileGenerator3: Host the DefineWindowsNULL. 2015-05-16 05:20:36 +02:00