1092 Commits

Author SHA1 Message Date
Ruslan Baratov
6b6191d875 Add variable 'CMAKE_INTERPROCEDURAL_OPTIMIZATION' 2017-03-02 09:37:39 -05:00
Sebastian Holtermann
1cdf7c1be2 Autogen: Add AUTOUIC_SEARCH_PATHS support
Closes #15227
2017-03-02 09:10:01 -05:00
Sebastian Holtermann
70ebf35cda Autogen: Add AUTOMOC_DEPEND_FILTERS support 2017-02-22 21:13:48 +01:00
Clinton Stimpson
f7b9bf41c5 Apple: Add BUILD_WITH_INSTALL_NAME_DIR target property
This new property controls whether to apply INSTALL_NAME_DIR to the
build tree.  It also overrides BUILD_WITH_INSTALL_RPATH.
2017-02-14 14:28:07 -07:00
Gregor Jasny
071f8e78dd Apple: Add support for static frameworks
Closes: #16432
2017-01-31 08:59:15 -05:00
Jamie Snape
0618ddf6b1 Add properties to run the cpplint style checker with the compiler
Create a `<LANG>_CPPLINT` target property (initialized by a
`CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker
command line to be run along with the compiler.
2017-01-23 14:47:13 -05:00
Gregor Jasny
d9f836e956 Add a getter for manually added target dependencies
Closes: #16165
2017-01-16 22:38:24 +01:00
Gregor Jasny
98f2143305 cmTarget: Enforce TYPE being a read-only property 2017-01-09 16:00:39 -05:00
Brad King
4838ca14df Merge topic 'initial_cuda_language_support'
4cc601f2 Help: Add release note for CUDA support
7b9131da CUDA: Add tests to verify CUDA compiler works properly.
9cf5b98d CUDA: Prefer environment variables CUDACXX and CUDAHOSTCXX.
a5e806b3 CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY
d038559e CUDA: Add separable compilation support to the makefile generator.
43ce4414 CUDA: Add separable compilation support to the ninja generator.
4b316097 CUDA: Add support for the CUDA_SEPARABLE_COMPILATION target property
ae05fcc6 CUDA: Add LinkLineComputer that computes cuda dlink lines.
115269a8 CUDA: Refactor cmLinkLineComputer to allow for better derived children.
5dec4031 CUDA: Refactor CMakeCUDAInformation to prepare for separable compilation.
5b20d0ab CUDA: C++ compile features now enable cuda c++11 support.
489c52ce CUDA: Use the host compiler for linking CUDA executables and shared libs.
bbaf2434 CUDA: add support for specifying an explicit host compiler.
a92f8d96 CUDA: Enable header dependency scanning.
ec6ce623 CUDA: State that cuda has preprocessor output and can generate assembly.
4f5155f6 CUDA: We now properly perform CUDA compiler identification.
...
2016-11-29 08:59:03 -05:00
Brad King
460052516f Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE libraries
Imported INTERFACE libraries can specify include directories via
`INTERFACE_INCLUDE_DIRECTORIES` so the default behavior of treating them
as system include directories applies.  Allow users to turn this off by
setting `NO_SYSTEM_FROM_IMPORTED` on such targets.

Closes: #16443
2016-11-21 11:42:01 -05:00
Robert Maynard
a5e806b3f5 CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY 2016-11-14 16:40:49 -05:00
Robert Maynard
ce4ec876ce CUDA: Add support language levels (98/11) 2016-11-14 11:36:43 -05: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
Brad King
1d1f1eeb6a cmTarget: Refactor GetMappedConfig to choose location property up front
Store the `IMPORTED_LOCATION` property name in a variable up front
to avoid duplicating the string literal.
2016-11-03 16:10:35 -04:00
Brad King
479932fa32 cmTarget: Add comment clarifying interface library special case 2016-11-03 16:02:49 -04:00
Brad King
925e4270fd cmTarget: Clarify comments in GetMappedConfig
Clarify comments explaining the availability of a target location
(file on disk) to distinguish this from the existence of the target.
2016-11-03 14:53:35 -04:00
Daniel Pfeifer
c15dc19728 Introduce CM_UNORDERED_SET
Avoid duplicating switch among std::unordered_set, cmsys::hash_set, and
std::set.
2016-10-24 22:34:52 +02:00
Brad King
dd7f9d8393 Merge topic 'allow-fallback-config-mapping'
587ab322 Tests: Add test for MAP_IMPORTED_CONFIG_<CONFIG> empty fallback
149d49ea Teach MAP_IMPORTED_CONFIG_<CONFIG> to support configuration-less import
60d73393 Help: Format MAP_IMPORTED_CONFIG_<CONFIG> documentation
2016-10-21 08:59:37 -04:00
Jens Weggemann
149d49ea7c Teach MAP_IMPORTED_CONFIG_<CONFIG> to support configuration-less import
If this property has an empty list entry, check for `IMPORTED_LOCATION`
instead of `IMPORTED_LOCATION_<CONFIG>`.  This allows custom imported
targets to have some configurations mapped and others fall back to a
default location.

Closes: #16280
2016-10-20 11:51:10 -04:00
Brad King
a5f4463eed Merge topic 'clang-tidy'
effa6c83 fix more issues reported by clang-tidy
fb461cac silence selected clang-tidy violations
2016-10-20 08:51:09 -04:00
Daniel Pfeifer
effa6c8343 fix more issues reported by clang-tidy 2016-10-20 08:48:20 -04:00
Stephen Kelly
e6eecec761 cmListFileCache: Remove cmState header include
Include it in dependents which have previously relied on it
transitively.
2016-10-19 15:41:00 +02:00
Stephen Kelly
2fe3e55d53 cmState: Move CacheEntryType enum to separate namespace
Port dependent code to the change.
2016-10-19 15:40:58 +02:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Stephen Kelly
cef59bb8ba cmTarget: Implement GetProperty in terms of cmState::Snapshot 2016-10-16 13:57:53 +02:00
Stephen Kelly
0d57b07ad9 cmTarget: Group code for checking written properties together 2016-10-16 13:57:53 +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
848ae2a663 cmTargetPropertyComputer: Template some methods on the Target
Implement the methods for cmTarget in the cmTarget source.
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
Stephen Kelly
637e3f3ee1 cmTargetPropertyComputer: Unify whitelist handling from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
05251e6d80 cmTargetPropertyComputer: Move whitelist check from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
fbf1721c94 cmTargetPropertyComputer: Extract into new files 2016-10-15 11:14:21 +02:00
Stephen Kelly
390a7d8647 cmTargetPropertyComputer: Implement GetProperty without cmMakefile
Only a cmMessenger and a backtrace are needed.
2016-10-15 11:14:21 +02:00
Stephen Kelly
7863fba1f6 cmTarget: Extract GetLocation method 2016-10-15 11:14:21 +02:00
Stephen Kelly
8096682e4e cmTarget: Extract GetSources method 2016-10-15 11:14:21 +02:00
Stephen Kelly
7d57c1a2c9 cmTarget: Extract location computation methods 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
705fcf522b cmTarget: Move IMPORTED check to callers
This way the policy can be checked without depending on cmTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
1fb6f672bd cmTarget: Move SOURCES property computation before the rest
The SOURCES have to be computed.
2016-10-15 11:14:21 +02:00
Stephen Kelly
aaa5dbbf64 cmTarget: Use static storage for computed properties
Avoid having to populate a mutable container to return a value.
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
Stephen Kelly
3b4895fa35 cmTarget: Inline MergeLinkLibraries into only caller 2016-10-07 20:13:33 +02:00
Stephen Kelly
2232e97a6e cmTarget: Remove useless link library state 2016-10-07 20:13:33 +02:00
Stephen Kelly
9a1d4e4ba1 cmTarget: Remove addition of zero when merging link libraries
The size is always zero when this is called.
2016-10-07 20:13:33 +02:00
Stephen Kelly
8391b3015a cmTarget: Add assert about link data
MergeLinkLibraries is called only from

 cmMakefile::AddGlobalLinkInformation

which is only called immediately after creating a target.
2016-10-07 20:13:32 +02:00
Ruslan Baratov
dc6d806660 Add a BUILD_RPATH target property specifying build-tree RPATH entries
Users may need to add custom `RPATH` entries to be able to run binaries
from their build tree without setting `LD_LIBRARY_PATH`.  Provide a way
to do this that does not affect the install-tree `RPATH`.
2016-10-03 13:42:27 -04: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
764775c4dd Fix XCODE_ATTRIBUTE_..._LOCATION target property lookup
Refactoring in commit v3.5.0-rc1~272^2~16 (cmGeneratorTarget: Add API for
property keys, 2015-10-25) changed the Xcode generator implementation of
`XCODE_ATTRIBUTE_...` properties to use the target `GetProperty` method on each
`XCODE_ATTRIBUTE_...` property listed by `GetPropertyKeys` instead of looping
over the property entries directly.  This made the lookup of property names of
the form `XCODE_ATTRIBUTE_..._LOCATION` accidentally trigger the computed
property logic for the undocumented/legacy `<CONFIG>_LOCATION` property.  Of
course the computed property value is not the same as the value stored in the
`XCODE_ATTRIBUTE_..._LOCATION` property.  Fix the computed property logic to
avoid triggering on `XCODE_ATTRIBUTE_...` attributes.

Closes: #16319
2016-09-22 11:29:52 -04:00