Commit Graph

348 Commits

Author SHA1 Message Date
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
Brad King
a2e91af99d cmGeneratorTarget: Drop unused GetIDLSources method 2017-04-11 13:36:40 -04:00
Brad King
60307c5056 cmGeneratorTarget: Replace source classifier implementation
Compute and memoize the list of sources with their kinds for each
configuration just once.
2017-04-07 15:35:48 -04:00
Brad King
c791fb1254 Merge topic '16733-bundle-genex'
d1dac1ac Xcode: Execute RunCMake.Framework also for Xcode generator
d02709d7 Genex: Add `TARGET_BUNDLE_[CONTENT_]_DIR` generator expressions
013ffe76 cmGeneratorTarget: Call GetFrameworkDirectory in GetFullNameInternal
32e9d0ca cmGeneratorTarget: Use enum to describe bundle directory query level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !635
2017-03-31 10:40:02 -04:00
Brad King
8772fc81c4 Merge topic 'ipo-policy-CMP0069'
dfa8263f Implement interprocedural optimization for GNU compilers
1588a577 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
a7575700 Refactoring: s,GetFeatureAsBool,IsIPOEnabled,
e05835c3 CheckIPOSupported: Visual Studio and Xcode generators do not support IPO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !568
2017-03-31 10:38:08 -04:00
Gregor Jasny
d02709d7f7 Genex: Add TARGET_BUNDLE_[CONTENT_]_DIR generator expressions
Closes #16733
2017-03-30 22:24:54 +02:00
Gregor Jasny
32e9d0ca23 cmGeneratorTarget: Use enum to describe bundle directory query level 2017-03-30 22:24:54 +02:00
Ruslan Baratov
dfa8263f4b Implement interprocedural optimization for GNU compilers
Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU
compilers by activating their link-time-optimization (LTO) flags.
2017-03-30 14:56:52 -04:00
Ruslan Baratov
1588a577d1 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was
honored only for the Intel compiler on Linux and otherwise ignored.  In
order to add support for more compilers incrementally without changing
behavior in the future, add a new policy whose NEW behavior enforces the
`INTERPROCEDURAL_OPTIMIZATION` property.  Add flags for supported
compilers and otherwise produce an error.
2017-03-30 14:56:46 -04:00
Ruslan Baratov
a75757004b Refactoring: s,GetFeatureAsBool,IsIPOEnabled,
Method 'GetFeatureAsBool' is used only with 'INTERPROCEDURAL_OPTIMIZATION'
feature. Substituting 'GetFeatureAsBool' with 'IsIPOEnabled'.
2017-03-30 10:16:30 -04:00
Gregor Jasny
060be58c6f Xcode: Properly handle Bundle Resources with more than one hierarchy level
Issue: #16680
2017-03-22 23:36:11 +01:00
Brad King
075f645409 Support WINDOWS_EXPORT_ALL_SYMBOLS with .def files
The `WINDOWS_EXPORT_ALL_SYMBOLS` target property exports all symbols
found in object files explicitly given to the linker.  However, the
linker may also find additional symbols in dependencies and copy them
into the linked binary (e.g. from `msvcrt.lib`).  Provide a way to
export an explicit list of such symbols by adding a `.def` file as a
source file.

Fixes: #16473
2017-03-21 10:02:34 -04:00
Brad King
f36eaf6a6e Refactor WINDOWS_EXPORT_ALL_SYMBOLS implementation
Use `cmGeneratorTarget::ModuleDefinitionInfo` to combine the
implementation of `WINDOWS_EXPORT_ALL_SYMBOLS` with that of using a
`.def` file as a source.  Only one of these could be used within a
single target before anyway.
2017-03-09 16:25:15 -05:00
Brad King
25d261efa7 Refactor module definition file selection
Create a `ModuleDefinitionInfo` structure for each configuration of a
target to hold corresponding information about the selected module
definition file (`.def` source).
2017-03-09 16:25:14 -05:00
Brad King
1e0a9ac45d Refactor module definition source enumeration
Add a `cmGeneratorTarget::GetModuleDefinitionSources` method.
2017-03-09 16:24:27 -05:00
Dmitry Kochkin
73a6d4566a VS: Cache the list of xaml and resx headers
Speed up VS project generation with many such headers.
2017-02-27 09:22:08 -05:00
Clinton Stimpson
4bff2d14fd Apple: Refactor support for using INSTALL_NAME_DIR. 2017-02-14 14:28:01 -07:00
Sebastian Holtermann
8f47a5f16a cmGeneratorTarget: Add AddIncludeDirectory method (experimental) 2016-12-07 08:24:00 -05:00
Brad King
09cda9d5e7 Allow imported INTERFACE libraries to specify a link library name
Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library
name to be placed on the link line in place of an interface library
since it has no library file of its own.  Restrict use of the property
to imported `INTERFACE` libraries.

This will be particularly useful for find modules that need to provide
imported libraries from system SDKs where the full path to the library
file is not known.  Now such find modules will be able to provide an
imported interface library and set `IMPORTED_LIBNAME` to refer to the
SDK library by name.

Issue: #15267
2016-11-09 09:45:14 -05:00
Stephen Kelly
a91eaf3872 cmState: Port dependents to new cmStateTypes header 2016-10-19 15:40:59 +02:00
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
Stephen Kelly
bf2d061ad3 cmGeneratorTarget: Move FindTargetToLink from cmTarget. 2015-10-12 18:39:58 +02:00
Stephen Kelly
9ca4cae51e cmGeneratorTarget: Move GetUtilityItems from cmTarget. 2015-10-12 18:39:58 +02:00
Stephen Kelly
1c1c2a1201 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget. 2015-10-10 17:06:56 +02:00
Stephen Kelly
c66084f5d7 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget. 2015-10-10 11:22:41 +02:00
Stephen Kelly
83c29e3903 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget. 2015-10-10 11:22:27 +02:00
Stephen Kelly
c1f687b1ad cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal. 2015-10-10 11:22:20 +02:00
Stephen Kelly
a6e1f05c15 cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget. 2015-10-10 11:21:11 +02:00
Stephen Kelly
654002feb8 cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget. 2015-10-10 11:21:09 +02:00
Stephen Kelly
922c89014f cmGeneratorTarget: Port GetLinkInterface away from cmTarget. 2015-10-10 11:20:30 +02:00
Stephen Kelly
f539da126b cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget. 2015-10-10 11:14:31 +02:00
Stephen Kelly
3e428fdcb4 cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget. 2015-10-10 11:03:48 +02:00
Stephen Kelly
110fd2fba1 cmGeneratorTarget: Move GetOutputTargetType from cmTarget. 2015-10-10 11:03:48 +02:00
Stephen Kelly
e73916992c cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget. 2015-10-10 11:03:48 +02:00
Stephen Kelly
c5718217ad cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget. 2015-10-09 01:04:38 +02:00
Stephen Kelly
bf5eb4a3f3 cmGeneratorTarget: Move ComputePDBOutputDir from cmTarget. 2015-10-09 01:04:38 +02:00
Stephen Kelly
49017cddab cmGeneratorTarget: Move IsNullImpliedByLinkLibraries from cmTarget. 2015-10-09 01:04:38 +02:00
Stephen Kelly
0bae4a416f cmGeneratorTarget: Move output info from cmTarget. 2015-10-09 01:04:38 +02:00
Stephen Kelly
1abc20d81d cmGeneratorTarget: Move UsesDefaultOutputDir from cmTarget. 2015-10-09 01:04:38 +02:00
Stephen Kelly
50dc9b4440 cmGeneratorTarget: Move GetPDBDirectory from cmTarget. 2015-10-09 01:04:37 +02:00
Stephen Kelly
8b0168863e cmGeneratorTarget: Move GetDirectory from cmTarget. 2015-10-09 01:04:37 +02:00
Stephen Kelly
df42dbb355 cmGeneratorTarget: Move link implementation from cmTarget. 2015-10-08 23:41:29 +02:00
Stephen Kelly
dce6581b7b cmGeneratorTarget: Move computed sources from cmTarget. 2015-10-07 08:37:58 +02:00
Stephen Kelly
c38e30f68c cmGeneratorTarget: Add methods for generate-time source addition. 2015-10-07 08:37:57 +02:00
Stephen Kelly
bf28b7874b cmGeneratorTarget: Rename internal member.
Leave the old name available for another use.
2015-10-06 20:16:20 +02:00
Brad King
e134e53b47 Add support for *.manifest source files with MSVC tools
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.

Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2015-09-17 10:21:32 -04:00
Stephen Kelly
616d8f02d5 cmGeneratorTarget: Rename method to match operation.
The manifest is computed, not generated, according to current language
used in cmake method naming.
2015-08-30 11:39:52 +02:00
Stephen Kelly
c2b7336ff3 cmGeneratorTarget: Move GetConfigCommonSourceFiles from cmTarget. 2015-08-26 19:46:33 +02:00
Stephen Kelly
69329fff70 cmGeneratorTarget: Move GetLanguages from cmTarget. 2015-08-26 19:46:32 +02:00
Stephen Kelly
0431f2c4d7 cmGeneratorTarget: Move ComputeLinkImplementationLanguages from cmTarget. 2015-08-26 19:46:32 +02:00
Stephen Kelly
abe9505df9 cmGeneratorTarget: Move HaveBuildTreeRPath from cmTarget. 2015-08-26 19:46:32 +02:00
Stephen Kelly
d4a24c0e95 cmGeneratorTarget: Move GetLinkImplementation from cmTarget. 2015-08-26 19:46:32 +02:00
Stephen Kelly
a7f5d70dde cmGeneratorTarget: Move compile defintions processing from cmTarget. 2015-08-26 19:46:30 +02:00
Stephen Kelly
d051086cce cmGeneratorTarget: Move compile features processing from cmTarget. 2015-08-26 19:46:10 +02:00
Stephen Kelly
db4cb92bda cmGeneratorTarget: Move compile options processing from cmTarget. 2015-08-26 19:45:51 +02:00
Stephen Kelly
e6ccbf6f30 cmGeneratorTarget: Move include directory processing from cmTarget. 2015-08-26 19:45:21 +02:00
Stephen Kelly
8bfb0c53da cmGeneratorTarget: Move link iface helpers from cmTarget. 2015-08-26 19:39:29 +02:00
Stephen Kelly
2cb3e57402 cmGeneratorTarget: Move GetImportLinkInterface from cmTarget. 2015-08-26 19:39:17 +02:00
Stephen Kelly
6d3d099b4a cmGeneratorTarget: Move ComputeLinkInterfaceLibraries from cmTarget. 2015-08-26 19:38:57 +02:00
Stephen Kelly
0db9d92787 cmGeneratorTarget: Move GetLinkInterfaceLibraries from cmTarget. 2015-08-26 19:38:37 +02:00
Stephen Kelly
84b847e42f cmGeneratorTarget: Move ComputeLinkInterface from cmTarget. 2015-08-26 19:38:14 +02:00
Stephen Kelly
6220241fd0 cmGeneratorTarget: Move GetLinkInterface from cmTarget. 2015-08-26 19:37:45 +02:00
Robert Goulet
3c37d2642d cmGeneratorTarget: Avoid recursion in GetOutputName method
Since support for generator expressions was added to OUTPUT_NAME it is
possible for project code to cause recursion in this method by using a
$<TARGET_FILE> genex.  Detect and reject such cases.
2015-08-20 09:56:45 -04:00
Stephen Kelly
f83e84028a cmGeneratorTarget: Move CompileInfoMap from cmTarget. 2015-08-05 18:20:50 +02:00
Stephen Kelly
b3f0e35308 cmGeneratorTarget: Move GetCompilePDBDirectory from cmTarget. 2015-08-05 18:20:50 +02:00
Stephen Kelly
34c437411d cmGeneratorTarget: Move GetOutputName from cmTarget. 2015-08-05 18:20:50 +02:00
Stephen Kelly
ee26add4f4 cmGeneratorTarget: Move IsBundleOnApple from cmTarget. 2015-08-05 18:20:49 +02:00
Stephen Kelly
f8076644ce cmGeneratorTarget: Move GetLinkClosure from cmTarget. 2015-08-05 18:20:49 +02:00
Stephen Kelly
7c809fa2a6 cmGeneratorTarget: Move GetLinkerLanguage from cmTarget. 2015-08-05 18:20:48 +02:00
Stephen Kelly
6da99de323 cmGeneratorTarget: Move GetFrameworkDirectory from cmTarget. 2015-08-05 18:20:48 +02:00
Stephen Kelly
d6bb319b09 cmGeneratorTarget: Move GetFullName from cmTarget.
Bring GetFullNameInternal with it.
2015-08-05 18:20:48 +02:00
Stephen Kelly
7a460852fa cmGeneratorTarget: Move GetAppBundleDirectory from cmTarget. 2015-08-05 18:20:48 +02:00
Stephen Kelly
d560bfd273 cmGeneratorTarget: Move GetInstallNameDir* from cmTarget. 2015-08-05 18:20:47 +02:00
Stephen Kelly
89e2a080e9 cmGeneratorTarget: Move GetMacContentDirectory from cmTarget. 2015-08-05 18:20:47 +02:00
Stephen Kelly
62720e44be cmGeneratorTarget: Move GetFullNameComponents from cmTarget. 2015-08-05 18:20:47 +02:00
Stephen Kelly
e27d737e27 cmGeneratorTarget: Move IsChrPathUsed from cmTarget. 2015-08-05 18:20:47 +02:00
Stephen Kelly
8d2de00244 cmGeneratorTarget: Move NeedRelinkBeforeInstall from cmTarget. 2015-08-05 18:20:47 +02:00
Stephen Kelly
3df705681b cmGeneratorTarget: Move GetPDBName from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly
a45fed81e5 cmGeneratorTarget: Move GetCompilePDBPath from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly
f0aa660772 cmGeneratorTarget: Move HasSOName from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly
766839c56d cmGeneratorTarget: Move GetLibraryNames from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly
47803e6f8e cmGeneratorTarget: Move GetExecutableNames from cmTarget. 2015-08-05 18:20:46 +02:00
Stephen Kelly
7da4c9d4ed cmGeneratorTarget: Move GetLinkImplementationClosure 2015-08-05 18:20:45 +02:00
Stephen Kelly
97f10e488a cmGeneratorTarget: Move ReportPropertyOrigin from cmTarget. 2015-08-05 18:20:45 +02:00
Stephen Kelly
5ff813c7a6 cmGeneratorTarget: Move LinkInterfaceDependent methods from cmTarget. 2015-08-05 18:20:45 +02:00
Stephen Kelly
90bad039c4 cmGeneratorTarget: Move CheckPropertyCompatibility from cmTarget. 2015-08-05 18:20:44 +02:00
Stephen Kelly
803a7982b4 cmGeneratorTarget: Move GetLinkInformation from cmTarget 2015-08-05 18:20:44 +02:00
Stephen Kelly
244c5b5dcd cmGeneratorTarget: Move IsLinkInterfaceDependent* from cmTarget. 2015-08-05 18:20:44 +02:00
Stephen Kelly
12bc571c13 cmGeneratorTarget: Move GetAutoUicOptions from cmTarget. 2015-08-05 18:20:43 +02:00
Stephen Kelly
41abdc17df cmGeneratorTarget: Move GetSOName from cmTarget.. 2015-08-05 18:20:43 +02:00
Stephen Kelly
ec38e4c84f Move GetFullPath to cmGeneratorTarget 2015-07-27 21:59:02 +02:00
Stephen Kelly
dfb025bf12 Move GetLocationForBuild to cmGeneratorTarget. 2015-07-27 21:58:50 +02:00
Stephen Kelly
9f2dca805c Move GetLocation to cmGeneratorTarget. 2015-07-27 21:58:50 +02:00
Stephen Kelly
a3b210fd6c cmGeneratorTarget: Require a cmLocalGenerator to construct. 2015-06-22 13:23:45 -04:00
Stephen Kelly
b2b41b83ff cmGeneratorTarget: Add accessor for cmLocalGenerator. 2015-06-22 13:23:45 -04:00
Stephen Kelly
ccbc225913 cmGeneratorTarget: Move Feature API from cmTarget. 2015-06-06 15:44:16 +02:00
Gilles Khouzam
01a9ab0def VS: Add support for XAML source files
XAML files are by default of type Page in the vcxproj and can be
overriden by setting the VS_XAML_TYPE property.  The .cpp and .h file
of the same name are automatically added as depending on the XAML file.

New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013.
2015-04-03 13:40:35 -04:00
Stephen Kelly
b734fa4471 Genex: Allow COMPILE_LANGUAGE when processing include directories.
Issue an error if this is encountered by an IDE generator.
2015-03-09 20:49:17 +01:00
Gilles Khouzam
401269e43b VS: Handle .pfx files explicitly in generator
Teach cmGeneratorTarget to classify .pfx files as package
certificate key files.  Teach cmVisualStudio10TargetGenerator
to write them as PackageCertificateKeyFile in .vcxproj files.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2014-08-21 09:28:20 -04:00
Gilles Khouzam
23782171ad VS: Handle AppxManifest sources explicitly in generator
Teach cmGeneratorTarget to extract .appxmanifest sources separately.
Teach cmVisualStudio10TargetGenerator to write them with the
AppxManifest tool in .vcxproj files.  This will allow us to detect
whether the project provides an application manfiest explicitly.
2014-08-21 09:28:20 -04:00
Brad King
5d12b87b9d cmGeneratorTarget: Improve GetCreateRuleVariable API
Pass the language and configuration to the method so it can return the
complete rule variable name.
2014-05-21 09:38:24 -04:00
Stephen Kelly
e6971df6ab cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.

Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.

Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.

Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
2014-04-02 23:14:02 +02:00
Stephen Kelly
aa0a3562dd cmGeneratorTarget: Compute target objects on demand
Add a ComputeObjectMapping method to compute the object
names.  It takes mapping to populate as an out-parameter so
that it can be extended in the future with parameters
relevant to generator expression evaluation.

Remove the supporting cmGeneratorTarget::AddObject method. It is
no longer needed as the container member is populated directly.

The ComputeObjectMapping method is called whenever objects are
requested from the cmGeneratorTarget.  Because the Xcode generator
makes no such request, explicitly invoke the method from that
generator so that the logic of checking for bad sources in object
libraries is executed.

In a follow-up, the UseObjectLibraries usage may be replaced by a
true generator expression evaluator for TARGET_OBJECTS. That
will require generators to use cmGeneratorTarget::GetExternalObjects
which is not currently the case for Xcode and VS generators.
2014-04-02 23:12:57 +02:00
Stephen Kelly
fdcefe3c42 cmGeneratorTarget: Compute consumed object libraries on demand.
Remove up-front object library computation from cmGlobalGenerator.

Adjust tests for message coming from the generator expression
evaluation.
2014-04-02 23:12:56 +02:00
Stephen Kelly
c481fadc07 cmGeneratorTarget: Don't store ObjectSources for object libraries.
Compute them on demand instead.
2014-03-15 09:29:44 +01:00
Stephen Kelly
9ad804ac7b cmGeneratorTarget: Constify cmSourceFile* in containers.
Some of them will be used with other APIs which require value_type
to be cmSourceFile const*.
2014-03-13 15:27:23 +01:00
Stephen Kelly
dcfcd23ed5 cmGeneratorTarget: Make GetSourceDepends const. 2014-03-13 15:27:23 +01:00
Stephen Kelly
6132d979d9 cmGeneratorTarget: Constify the AddExplicitObjectName API.
The storage is already const.
2014-03-13 15:27:23 +01:00
Stephen Kelly
bc51221164 cmGeneratorTarget: Constify the AddObject API.
The storage is already const.
2014-03-13 15:27:23 +01:00
Ben Boeckel
84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel
fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel
ec97ed7d0c stringapi: Use strings for property names
Property names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Stephen Kelly
64d398416a cmGeneratorTarget: Classify sources on demand, not up front.
Implement a Visitor to hold the sequence of source file tests
for populating outputs.  Use VS 6 and 7 workaround from Brad
King for lack of partial template specialization and function
template specialization capabilities.

This will make it possible to use context dependent generator
expressions to determine the sources of a target.
2014-02-24 16:44:51 +01:00
Stephen Kelly
d3682d8647 cmGeneratorTarget: Use a method to access the definition file. 2014-02-24 16:43:25 +01:00
Stephen Kelly
84e5f5a004 cmTarget: Move SourceFileFlags to cmGeneratorTarget. 2014-02-24 16:43:23 +01:00
Stephen Kelly
8fd0f2a718 cmGeneratorTarget: Hold a const global generator. 2014-01-12 20:18:11 +01:00
Stephen Kelly
531e40b95e cmTarget: Make GetSourceFiles populate an out-vector parameter.
In a future patch, this will also be populated with extra
sources from the linked dependencies.
2014-01-09 19:38:08 +01:00
Stephen Kelly
38de54cf6f cmGeneratorTarget: Add methods to access source file groups.
These methods and others will be able to get a config parameter
later to implement the INTERFACE_SOURCES feature.
2014-01-09 19:38:07 +01:00
Stephen Kelly
a54eeddaae Constify cmGeneratorTarget access. 2013-12-11 15:30:11 +01:00
Stephen Kelly
259bf0918c Make the cmStrictTargetComparison operate on const cmTarget*. 2013-12-04 13:43:30 +01:00
Stephen Kelly
abb13ea565 Order cmGeneratorTargetsType elements deterministically.
Define a custom ordering functor to deterministically and strictly
order the cmTarget* key. Otherwise the order would be dependent on
runtime pointer values, which breaks assumptions of some generators.

The functor orders first by target name, and then by directory. Multiple
global targets may have the same name, such as edit_cache, but their
directory differentiates them.
2013-11-22 15:06:25 +01:00
Stephen Kelly
0f876439e9 cmGeneratorTarget: Make GetIncludeDirectories const. 2013-11-19 18:07:04 +01:00
Stephen Kelly
af4c1096f6 cmGeneratorTarget: Make some accessors const. 2013-11-03 22:27:28 +01:00
Stephen Kelly
07f5788385 Move TraceDependencies to cmGeneratorTarget. 2013-10-30 21:29:45 +01:00
Stephen Kelly
90ef1cfe48 Move GenerateTargetManifest to cmGeneratorTarget. 2013-10-27 20:29:45 +01:00
Stephen Kelly
25f1df3e81 Split CreateGeneratorTargets into two methods.
As the generate-time-related API is moving to cmGeneratorTarget, almost
all of generation code needs to be able to access instances of it.
2013-10-27 20:29:34 +01:00
Stephen Kelly
9cf3547e1c Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
Unlike other target properties, this does not have a corresponding
non-INTERFACE variant.

This allows propagation of system attribute on include directories
from link dependents.
2013-07-16 13:44:57 -04:00
Stephen Kelly
f1fcbe3fde Add Target API to determine if an include is a system include.
The implementation can be modified later so that system includes
can be determined on a per-target basis.
2013-07-02 16:40:02 +02:00
John Farrier
79ec7868d0 VS: Add Windows Forms Support
Add support to maintain designer functionality for Visual Studio C++
Windows Forms projects.  Also add a test project showing how to use
the CMakeLists.txt file and, when successfully configured, will allow
use of the designer for the included form.
2013-05-16 13:06:44 -04:00
Stephen Kelly
0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -05:00
Stephen Kelly
0bbae6f95f Revert "Move GetLinkInformation to cmGeneratorTarget"
As we can't move all linking related code from cmTarget, it makes
sense to reverse the move in some cases.

This reverts commit 4f5384e75c.
2012-11-21 15:49:37 +01:00
Stephen Kelly
2a6bd96c13 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.
2012-10-17 16:24:14 -04:00
Stephen Kelly
2c2b25b203 Return a std::string from GetCompileDefinitions. 2012-09-21 13:28:54 +02:00
Stephen Kelly
879fd354c1 Revert "Move GenerateTargetManifest to cmGeneratorTarget."
This reverts commit 987e12e2f9.

GenerateTargetManifest is called by the global generator before it
creates the generator targets, so we can't move it to cmGeneratorTarget
yet.
2012-09-20 08:34:30 +02:00
Stephen Kelly
c31f3d99f8 Add a wrapper for accessing config-specific compile-definitions. 2012-09-19 15:32:19 +02:00
Stephen Kelly
290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Stephen Kelly
9facfd1336 Move GetCreateRuleVariable to cmGeneratorTarget. 2012-09-19 15:31:32 +02:00
Stephen Kelly
78bfee35d5 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget. 2012-09-19 15:31:29 +02:00
Stephen Kelly
4f5384e75c Move GetLinkInformation to cmGeneratorTarget 2012-09-19 15:30:57 +02:00
Stephen Kelly
987e12e2f9 Move GenerateTargetManifest to cmGeneratorTarget. 2012-09-19 15:30:49 +02:00
Stephen Kelly
14bf7783f4 Store cmGeneratorTargets with the makefile. 2012-09-19 15:29:07 +02:00
Stephen Kelly
f428ca25f5 Add more forwarding API to cmGeneratorTarget.
This API is the most commonly required in the following patches.
2012-09-19 15:28:03 +02:00
Brad King
470f39cf4e VS: Restore header files marked as OS X Framework content (#13196)
Header files listed in a target's PUBLIC_HEADER or similar properties
are marked as OS X Framework content.  Refactoring performed by

 commit 11d9b211 (Add cmGeneratorTarget to represent a target during generation, 2012-03-07)
 commit 45c2f932 (Simplify cmMakefileTargetGenerator using cmGeneratorTarget, 2012-03-07)
 commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source classification, 2012-03-19)

and related commits accidentally removed such files from treatment as
normal header files by the VS generator (generators other than Makefiles
and Xcode).  Move handling of such files out of cmGeneratorTarget and
back to cmMakefileTargetGenerator.  The central cmGeneratorTarget
classification will always treat them as header or extra sources.
2012-05-07 15:28:19 -04:00
Brad King
328c0f65c2 Simplify cmVisualStudio10TargetGenerator source classification
Combine WriteCLSources and WriteObjSources into a single method.  Use
the cmGeneratorTarget source classification to simplify tool selection
for each source file.  Extend the classification to handle .idl files.
2012-03-19 17:13:41 -04:00
Brad King
c403f27a2d Add $<TARGET_OBJECTS:...> expression to use an object library
For now do not allow an OBJECT library to reference other object
libraries.  Teach cmTarget::ComputeLinkImplementation to include the
languages of object libraries used by a target.
2012-03-16 10:12:15 -04:00
Brad King
f737bd416a Pre-compute and store target object directory in cmGeneratorTarget
Add cmGeneratorTarget::ObjectDirectory member to hold the value.  In
ComputeTargetObjects set the value to the full path to the target object
directory including any necessary placeholder for the configuration
name.
2012-03-12 16:44:03 -04:00
Brad King
d57047de33 Pre-compute object file names before VS project generation
Implement cmGlobalGenerator::ComputeTargetObjects in the VS generator
to pre-compute all the object file names.  Use the results during
generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King
3baaf6ccec Pre-compute object file names before Makefile generation
Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked
during cmGeneratorTarget construction.  Implement it in the Makefile
generator to pre-compute all object file names for each target.  Use
the results during generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King
11d9b21126 Add cmGeneratorTarget to represent a target during generation
Some per-target information and logic is common to all generators.
Some of that information is currently stored in cmTarget but that
should be reserved for the configure step.  Create a class to hold
per-target information for generators.  On construction classify
sources from the target and store them in separate members.  This
classification is already implemented separately in each generator.
2012-03-09 15:16:02 -05:00