1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-23 21:00:46 +08:00

544 Commits

Author SHA1 Message Date
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Sebastian Holtermann
de0d57c97a cmTarget: Use std::unique_ptr instead of custom smart pointer
To manage the lifetime of `cmTargetInternals`, the private implementation of
`cmTarget`, use `std::unique_ptr<cmTargetInternals>` instead of
`cmTargetInternalPointer`, which is removed.

`cmTarget` is made non-copyable but movable.
2019-03-23 22:22:34 +01:00
Sebastian Holtermann
ecc782c75d cmTarget: Single line comment clanups 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
be2764a657 cmTarget: Make private SetPropertyDefault an in code lambda InitProperty 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
2bfee8a58b cmTarget: Remove obsolete friend definitions 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
a65a404186 cmTarget: Inline private HasImportLibrary method 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
ff91071a14 cmTarget: Move member method CheckImportedLibName to impl 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
afc4612fa5 cmTarget: Move member method ProcessSourceItemCMP0049() to impl 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
72b0eeeb21 cmTarget: Move member booleans to impl 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
db182eb160 cmTarget: Move member *Commands to impl 2019-03-23 22:22:34 +01:00
Sebastian Holtermann
30495bb1c2 cmTarget: Move member RuntimeInstallPath to impl 2019-03-23 21:45:10 +01:00
Sebastian Holtermann
0dcef68cd8 cmTarget: Move member InstallPath to impl 2019-03-23 21:45:10 +01:00
Sebastian Holtermann
5db17e9d81 cmTarget: Move member Name to impl 2019-03-23 21:45:10 +01:00
Sebastian Holtermann
ccf76c6e4c cmTarget: Move member TLLCommands to impl 2019-03-23 21:45:10 +01:00
Sebastian Holtermann
7742bf4ff5 cmTarget: Move member Backtrace to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
2c14eb4852 cmTarget: Move member PolicyMap to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
f6241db3e0 cmTarget: Move member OriginalLinkLibraries to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
3c09bf0fa7 cmTarget: Move member Utilities to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
856a271fb7 cmTarget: Move member SystemIncludeDirectories to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
46075091d5 cmTarget: Move member Properties to impl class 2019-03-23 21:15:32 +01:00
Sebastian Holtermann
2cd4104600 cmTarget: Move member Makefile to impl 2019-03-23 15:10:50 +01:00
Sebastian Holtermann
fa8e2dfc7b cmTarget: Move member TargetType to impl 2019-03-23 15:04:56 +01:00
Sebastian Holtermann
c9bd2e941f cmTarget: Rename member Internal to impl 2019-03-23 15:04:42 +01:00
Sebastian Holtermann
a42b700cc2 cmTarget,cmGeneratorTarget: Add optional before parameter to AddSource
The new optional `before` parameter in `cmTarget::AddSource` and
`cmGeneratorTarget::AddSource` allows to prepend a source file
to the sources list instead of appending it.
2019-01-18 13:47:23 +01:00
Artur Ryt
ecf6fc8dc1 cmTarget: Remove unused classes cmTargetSet and cmTargetManifest 2018-12-06 11:40:13 -05:00
Brad King
a6e02f881d add_dependencies: Track backtraces internally
Record backtraces for "utility" dependencies created by
`add_dependencies` calls.
2018-10-18 08:10:55 -04:00
Marc Chevrier
a71caab46b LINK_DIRECTORIES: Add new properties and commands
These new capabilities enable to manage link directories

Two new properties:
* target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES

One new command
* target_link_directories(): to populate target properties

Fixes: #17215
2018-09-25 23:59:58 +10:00
Brad King
a1ad0a699b target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory.  Lift this restriction to
enable more flexible use by projects.

Targets named on the RHS will need to be looked up during generation in
the scope of the call site rather than the scope of the LHS target.
Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties
to specify target names that need to be looked up in a directory other
than that containing the target on which the property is set.  Add
minimal documentation of the syntax to help users that encounter it.

Unfortunately CMake previously did allow such calls in the case that
only `INTERFACE` libraries are specified, but those libraries would be
looked up in the target's directory rather than the caller's.  Add
policy `CMP0079` to enable the new behavior with new lookup scope in a
compatible way.

Fixes: #17943
2018-09-12 13:06:36 -04:00
Sebastian Holtermann
127094f2f0 Add GetSafeProperty method to cmTarget, cmGeneratorTarget and cmSourceFile 2018-07-02 12:39:54 +02:00
Marc Chevrier
c1f5a44b28 LINK_OPTIONS: Add new family of properties
This family enable to manage link flags

Three new properties:
* directory property: LINK_OPTIONS
* target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS

Two new commands
* add_link_options(): to populate directory property
* target_link_options(): to populate target properties

Fixes: #16543
2018-06-06 17:22:39 +02:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* 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.
2018-06-01 09:53:42 -04:00
Brad King
2124a1364a cmTarget: Remove unnecessary RecordDependencies member
Inline the condition in the one remaining place it is checked.
2018-03-06 14:38:23 -05:00
Brad King
910a9d608e cmTarget: Simplify ClearDependencyInformation signature
We don't need to pass an argument with the target's own name.
2018-03-06 13:54:45 -05:00
Justin Goshi
afd9a339a1 server: return whether or not a target is generator provided
Some generators auto-generate targets. For example VS generators create
the ALL_BUILD target. Add the ability to mark targets as generator
provided and return that info through cmake-server codemodel.
2017-11-20 14:29:50 -05:00
Daniel Pfeifer
2b4c32c95f clang-format: format all code as Cpp11 2017-08-30 11:07:05 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Daniel Pfeifer
cbcfb79f9c Use C++11 unordered containers 2017-08-22 23:05:27 +02:00
Gregor Jasny
cf320f7cd7 Replace boolean implib parameters with enum
Named enumeration values are much clearer at call sites and add more
type safety.
2017-04-20 10:22:33 -04: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
Brad King
453df662ba Merge topic 'imported-interface-libname'
09cda9d5 Allow imported INTERFACE libraries to specify a link library name
1d1f1eeb cmTarget: Refactor GetMappedConfig to choose location property up front
479932fa cmTarget: Add comment clarifying interface library special case
925e4270 cmTarget: Clarify comments in GetMappedConfig
2016-11-09 09:49:49 -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
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Daniel Pfeifer
1a74e71906 Introduce CM_UNORDERED_MAP
Avoid duplicating switch among std::unordered_map, cmsys::hash_map, and
std::map.
2016-10-24 09:58:52 -04: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
Stephen Kelly
c3fb0d95ad cmTarget: Move sanity checks and computed property access to callers
The GetProperty method is now just accessing contained data, meaning it
can be implemented in cmState.

Remove the cmMakefile context from the signature as a result and remove
the overload with the same signature.

Add a GetComputedProperty to cmTarget so that templates can be properly
instantiated.  Otherwise the Commands would need to be able to reach the
specializations which are currently in cmTarget.cxx.

As a side-effect, the CMP0026 warning now gives a backtrace to the
target when issued from a generator expression.
2016-10-16 13:56:12 +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
Stephen Kelly
a55cac4ba4 cmTarget: Split property computation into separate class
Everything related to property computation will be moved here and
eventually shared with cmGeneratorTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
60b3f216c1 cmTarget: Remove mutable marker from properties 2016-10-15 11:14:21 +02:00
Stephen Kelly
d9b5f0a301 cmTarget: Remove target name from parameter list
Use the member state instead.
2016-10-07 20:13:36 +02:00