178 Commits

Author SHA1 Message Date
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Brad King
188c762f8a Merge topic 'extract-computed-target-properties'
cef59bb8 cmTarget: Implement GetProperty in terms of cmState::Snapshot
0d57b07a cmTarget: Group code for checking written properties together
c3fb0d95 cmTarget: Move sanity checks and computed property access to callers
fa9dbc56 cmGeneratorTarget: Implement cmTargetPropertyComputer interface
848ae2a6 cmTargetPropertyComputer: Template some methods on the Target
a0a720e6 cm{,Generator}Target: Add global generator accessors
637e3f3e cmTargetPropertyComputer: Unify whitelist handling from cmTarget
05251e6d cmTargetPropertyComputer: Move whitelist check from cmTarget
fbf1721c cmTargetPropertyComputer: Extract into new files
390a7d86 cmTargetPropertyComputer: Implement GetProperty without cmMakefile
e32a6bdd cmListFileBacktrace: Add a method to retrieve the Bottom of a snapshot
7863fba1 cmTarget: Extract GetLocation method
8096682e cmTarget: Extract GetSources method
7d57c1a2 cmTarget: Extract location computation methods
a55cac4b cmTarget: Split property computation into separate class
705fcf52 cmTarget: Move IMPORTED check to callers
...
2016-10-17 10:15:21 -04:00
Gregor Jasny
3b6f1587be Factor IDE folder name retrieval out into helper method
Add a `cmGeneratorTarget::GetEffectiveFolderName` helper to abstract
lookup of the `FOLDER` property in combination with checking for
generator support of folders.
2016-10-17 10:06:18 -04:00
Stephen Kelly
fa9dbc56a1 cmGeneratorTarget: Implement cmTargetPropertyComputer interface
Populate a local member for the sources property when the instance is
created.  Pass the parameter to avoid the policy check when doing so.
Ordinarily, the GetSources function should not be called unconditionally
(at generate time), but we need to do so here in case the property is
read in a generator expression.  The intent is to be able to implement
cmGeneratorTarget without requiring cmTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
a0a720e6a7 cm{,Generator}Target: Add global generator accessors
Provide 'static polymorphism' between the types in this aspect so that
they can be used indiscriminately in a C++ template.
2016-10-15 11:14:21 +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
Brad King
7b5f85677c Fortran: Use module dir flag if needed for default module directory
Our buildsystem model says that the default Fortran module output
directory is the build tree directory corresponding to the source tree
`CMakeLists.txt` file adding the current target.  Extend
`cmGeneratorTarget::GetFortranModuleDirectory` to allow generators to
pass in the compiler working directory.  If the working directory does
not match the default Fortran module output directory then we need an
explicit module directory flag (e.g. `-J`) to tell the compiler to
put/use modules in the latter.

This does not affect the Makefile generator but will be useful for
future introduction of Fortran support to the Ninja generator.
2016-09-20 08:48:41 -04:00
Daniel Pfeifer
cc6b948e5e cmGeneratorTarget: factor out common part of AddSources commands 2016-09-08 23:47:16 +02:00
Daniel Pfeifer
efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Daniel Pfeifer
1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Tobias Hunger
49f10f0d24 cmGeneratorTarget: Adopt Fortran module directory generation
Move code to create/get the fortran module directory from the
cmCommonTargetGenerator to cmGeneratorTarget.

Rename the ComputeFortranModuleDirectory method to
CreateFortranModuleDirectory as this method *creates* the directory if
it is missing.
2016-06-17 14:22:29 -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
Christoph Grüninger
58a4a77132 Make cmLinkInterface:: and cmGeneratorTarget::Multiplicity unsigned ints 2016-02-04 10:57:02 -05:00
Milian Wolff
275f2a85b2 Remove temporary allocations when calling cmGeneratorTarget::GetName.
This happens quite often from within comparisons such as in
NamedGeneratorTargetFinder or FindGeneratorTargetImpl. It is the
top hotspot of both, number of allocations as well as number of
temporary allocations - the majority of calls lead to temporary
allocations.

In raw numbers, this patch removes ~1E6 temporary allocations of
1.5E6 temporary allocations in total when running the cmake daemon
on the KDevelop build dir. That is 2/3 of the total.

This hotspot was found with heaptrack.
2016-01-20 21:20:54 +01:00
Tim Grothe
247c168b98 Refactor .def file lookup
Return a `cmSourceFile const*` from GetModuleDefinitionFile so that
callers can get more information than just the path to the file.
2015-11-04 09:15:14 -05:00
Stephen Kelly
278ba2db47 cmGeneratorTarget: Add API for globally visible IMPORTED 2015-10-27 07:44:25 +01:00
Stephen Kelly
7f6beddae3 cmGeneratorTarget: Port cmOptionalLinkImplementation 2015-10-27 07:44:23 +01:00
Stephen Kelly
520ca0ff6c cmGeneratorTarget: Add API for property keys 2015-10-27 07:44:23 +01:00
Stephen Kelly
b397eae82e cmGeneratorTarget: Move LinkLanguagePropagatesToDependents from cmTarget 2015-10-27 07:44:21 +01:00
Stephen Kelly
7a1b83cb3f cmGeneratorTarget: Add GetUtilityBacktrace API 2015-10-27 07:44:21 +01:00
Stephen Kelly
736c2042c6 cmGeneratorTarget: Add GetUtilities API 2015-10-27 07:44:20 +01:00
Stephen Kelly
bde277e811 cmGeneratorTarget: Add GetLinkDirectories API. 2015-10-26 22:02:13 +01:00
Stephen Kelly
cf69630e51 cmGeneratorTarget: Move GetFrameworkVersion from cmTarget 2015-10-26 22:02:13 +01:00
Stephen Kelly
3f8aa62bfb cmGeneratorTarget: Add API for target-relative commands. 2015-10-26 22:02:13 +01:00
Stephen Kelly
f528e6bcb9 Makefiles: Port progress marks to cmGeneratorTarget. 2015-10-24 09:19:53 +02:00
Stephen Kelly
c2c239e607 cmGlobalGenerator: Move GeneratorTargetsType to usage site. 2015-10-24 09:19:52 +02:00
Stephen Kelly
d74bca5a8f cmGeneratorTarget: Copy the policy map from the cmTarget. 2015-10-21 00:52:23 +02:00
Stephen Kelly
6d94078e62 cmGeneratorTarget: Move IsDLLPlatform from cmTarget. 2015-10-21 00:52:22 +02:00
Stephen Kelly
3ebc62850c cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget. 2015-10-21 00:52:22 +02:00
Stephen Kelly
311018e5ad cmGeneratorTarget: Move GetExportMacro from cmTarget. 2015-10-21 00:52:22 +02:00
Stephen Kelly
215cd21a02 cmGeneratorTarget: Provide direct access to the backtrace. 2015-10-21 00:37:03 +02:00
Stephen Kelly
83703bda7d cmGeneratorTarget: Copy IsExecutableWithExports from cmTarget. 2015-10-21 00:36:09 +02:00
Stephen Kelly
d8f8940bc6 cmGeneratorTarget: Move IsCFBundleOnApple from cmTarget. 2015-10-19 20:27:41 +02:00
Stephen Kelly
7550879f57 cmGeneratorTarget: Move IsXCTestOnApple from cmTarget. 2015-10-19 20:27:41 +02:00
Stephen Kelly
88d10d55ac cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.
Leave the cmTarget method behind for now to implement cmInstallCommand.
2015-10-19 20:27:41 +02:00
Stephen Kelly
b5f5de70c0 cmGeneratorTarget: Copy IsFrameworkOnApple from cmTarget.
Leave the cmTarget method behind for now to implement cmInstallCommand.
2015-10-19 20:27:41 +02:00
Stephen Kelly
8e20ea6ef2 cmGeneratorTarget: Move IsLinkable from cmTarget. 2015-10-19 20:27:40 +02:00
Stephen Kelly
eb3be7d688 cmGeneratorTarget: Move GetExportName from cmTarget. 2015-10-18 16:29:30 +02:00
Stephen Kelly
beff29f0d4 cmGeneratorTarget: Move ComputeVersionedName from cmTarget. 2015-10-16 20:24:44 +02:00
Stephen Kelly
12e4790a0b cmGeneratorTarget: Move GetTargetVersion from cmTarget. 2015-10-16 20:24:44 +02:00
Stephen Kelly
1427227720 cmGeneratorTarget: Move CheckCMP0004 from cmTarget. 2015-10-16 20:24:44 +02:00
Stephen Kelly
8f363d6771 cmGeneratorTarget: Move ImportInfo from cmTarget. 2015-10-16 20:24:43 +02:00
Stephen Kelly
a892b285f8 cmGeneratorTarget: Move ImportedGetLocation from cmTarget. 2015-10-16 20:24:43 +02:00
Stephen Kelly
cb8c728f17 cmGeneratorTarget: Move GetFullNameImported from cmTarget. 2015-10-16 20:24:43 +02:00
Stephen Kelly
60bd9f9c92 cmGeneratorTarget: Move GetObjectLibrariesCMP0026 from cmTarget. 2015-10-16 20:17:22 +02:00
Stephen Kelly
4ee2b26708 cmGeneratorTarget: Use enum for GetType. 2015-10-15 00:41:40 +02:00
Stephen Kelly
ce75c86ec3 cmGeneratorTarget: Move GetSupportDirectory from cmTarget. 2015-10-12 18:39:59 +02:00
Stephen Kelly
526cc7dc52 cmGeneratorTarget: Move HasImportLibrary from cmTarget. 2015-10-12 18:39:59 +02:00
Stephen Kelly
8d2e3e53b9 cmGeneratorTarget: Move HasImplibGNUtoMS from cmTarget. 2015-10-12 18:39:59 +02:00
Stephen Kelly
f7acd74215 cmGeneratorTarget: Port LinkImplClosure to cmGeneratorTarget. 2015-10-12 18:39:58 +02:00