Commit Graph

1329 Commits

Author SHA1 Message Date
Daniel Pfeifer 5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Sebastian Holtermann 8e452e67e9 Remove AUTOGEN variables from cmSourceFile and cmMakefile 2017-08-22 19:10:32 +02:00
Brad King 4f7d9eef51 Features: Fix COMPILE_FEATURES genex for C++ 14 and 17 features
When `CXX_STANDARD` is not at least 14 or 17, features enabled by the
compiler for those standards should not be reported as existing by the
`COMPILE_FEATURES` genex.  Fix the implementation and add a test.
2017-08-08 13:28:38 -04:00
Brad King f5be951117 Merge topic 'labels-for-subprojects'
376dc3eb Help: Add notes for topic 'labels_for_subprojects'
a70d8e93 Add tests for new directory labels and labels-for-subprojects features
47b3a57c Display subproject timing summary
d3859624 Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variable
d08ec4d2 Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1004
2017-07-13 07:46:09 -04:00
Brad King c8f4cf0821 Merge topic 'source-group-regex-tweaks'
2c82d9c8 Add more extensions to Resources source group by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1028
2017-07-13 07:42:42 -04:00
Betsy McPhail d385962419 Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variable
The specified LABELS will be passed down to subdirectories as well as
any targets or tests in the directory.
2017-07-10 16:25:18 -04:00
UfoXp 2c82d9c81f Add more extensions to Resources source group by default
Extend the Resources group regex to match pdf, png, jpeg, jpg,
storyboards, and xcassets.  This cleans up more complex Xcode projects a
lot.

While at it, factor the regular expressions for both "Resources" and
"Source Files" into macros.
2017-07-10 11:33:56 -04:00
Sylvain Joubert 58f4744821 configure_file: Add support for indented cmakedefine
Optional spaces and/or tabs are now understood between the '#' character
and the 'cmakedefine'/'cmakedefine01' words. This indentation is
preserved in the output lines.

Fixes: #13037
2017-07-04 12:00:02 +02:00
Brad King 43c3afa745 Merge topic 'fix-crash-on-non-enabled-language-features'
e03a1b3b target_compile_features: Do not crash on non-enabled language
86990427 Tests: Enable languages explicitly in RunCMake.target_compile_features

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1010
2017-06-27 09:20:32 -04:00
Brad King e03a1b3b61 target_compile_features: Do not crash on non-enabled language
Fixes: #17011
2017-06-26 13:54:20 -04:00
Brad King 82be694c7a file(GENERATE): Add policy CMP0070 to define relative path behavior
Previously `file(GENERATE)` did not define any behavior for relative
paths given to the `OUTPUT` or `INPUT` arguments.  Define behavior
consistent with CMake conventions and add a policy to provide
compatibility for projects that relied on the old accidental behavior.

Fixes: #16786
2017-06-09 10:38:43 -04:00
Brad King c6ea3f01c3 Merge topic 'lint-function-args'
b1ec5dea Pass large types by const&, small types by value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !927
2017-06-05 09:44:24 -04:00
Daniel Pfeifer b1ec5deaf1 Pass large types by const&, small types by value 2017-06-04 00:48:21 +02:00
Daniel Pfeifer 8d7b3ef5d4 Provide and use CM_FALLTHROUGH 2017-06-03 08:38:51 +02:00
Pavel Solodovnikov 8b6f439ef2 Access string npos without instance 2017-06-01 14:19:51 -04:00
Brad King 99b1ff714b Merge topic 'dead-code-removal'
fdd341eb cmFindCommon: remove unused function SetMakefile
67a8d907 cmExecutionStatus: Remove arguments from setters
0c519c70 bootstrap: Remove leftovers from cmBootstrapCommands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !821
2017-05-11 09:54:19 -04:00
Daniel Pfeifer 67a8d907ad cmExecutionStatus: Remove arguments from setters
The setters are only used to set boolean values.  The values are never
reset individually.
2017-05-09 23:49:14 +02:00
Daniel Pfeifer c3f41af2be cmMakefile: don't check IsScriptable 2017-05-08 22:58:01 +02:00
Daniel Pfeifer c36d63cd48 cmake: initialize with Role that controls which commands to register 2017-05-08 22:29:44 +02:00
Daniel Pfeifer ba8571ff2d clang-tidy: use operators for string comparison 2017-04-26 08:59:56 +02:00
Brad King 4f5bbbeab9 Add deprecation warnings for policies CMP0036 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
2017-04-21 15:04: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 22829a1304 cmMakefile: Create an explicit "Object Libraries" source group
The generators should not need special logic to place object library
object files in this group.
2017-04-11 10:09:57 -04:00
Daniel Pfeifer e9fc7ff505 Add self-sufficient wrapper for <sys/stat.h> 2017-03-24 22:58:25 +01:00
Brad King c4f9d10426 Merge topic 'master'
d9bdcf34 Tests: Add x32 tests to test suite
5b6d354f Help: Add notes for topic 'x32-abi'
bed9c73d Modules: Add x32-abi support to hard-coded paths
462cf254 Add support for x32-abi

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !532
2017-03-09 11:08:11 -05:00
Steven Newbury 462cf25427 Add support for x32-abi
Detect x32-abi through CMakeCompilerABI infrastruture and use this
information at runtime to determine the correct library paths with
`FIND_LIBRARY_USE_LIBX32_PATHS`.

Fixes: #15994
2017-03-07 15:22:55 -05:00
Ben Boeckel aba92ffd92 cmWorkingDirectory: use the new class
These functions just need to change the directory for a block of code
and then go back to the caller's expected location. Use
cmWorkingDirectory to ensure that all return paths are handled.
2017-03-06 10:38:58 -05:00
Brad King 32f13fbe09 Merge topic '16615-xcode-object-libraries-depends'
624021a0 Add test for object library dependencies
5da9266a Xcode: Always track object library dependencies via hacky Makefile
e80ac953 Xcode: Record dependency information also for object libraries
9293e57d Xcode: Collect dummy rules during iteration and emit afterwards
33a1d727 Makefile: Allow adding post-build rules to object libraries
2017-02-24 09:31:39 -05:00
Gregor Jasny 33a1d727d5 Makefile: Allow adding post-build rules to object libraries 2017-02-22 17:05:17 +01:00
Brad King 53a1ec631d Merge topic 'fix-CMP0017-path-case'
e2d78f75 Windows: Fix inconsistent behavior on changes to case of path to cmake
2017-02-20 10:42:57 -05:00
Brad King e2d78f7535 Windows: Fix inconsistent behavior on changes to case of path to cmake
In commit v3.4.0-rc1~333^2 (Merge branch 'upstream-kwsys' into
update-kwsys, 2015-07-15) we brought in upstream KWSys commit 86a24794
(SystemTools: Fix GetActualCaseForPath drive letter case handling,
2015-07-09).  This caused our path processing to convert drive letters
to upper-case and exposed an existing bug in our implementation of
CMP0017.

Policy CMP0017 is responsible for ensuring that modules included from a
builtin module only load other builtin modules and cannot be overridden
by a file in `CMAKE_MODULE_PATH`.  If there is a case difference in the
drive letter (or other path components) then the path to the including
module may not match our builtin module directory in a simple string
comparison.  This means builtin modules may not be recognized as such,
and they may not reliably include their builtin dependencies.  For
example, if a project provides a `Platform/Windows` module in
`CMAKE_MODULE_PATH` it can break inclusion of our builtin
`Platform/Windows` module, leading to strange behavior.

Fix this by comparing the path to the including module to our builtin
module directory using a function that is aware of case-insensitivity of
paths on Windows.

Fixes: #16648, #16622
2017-02-17 11:10:45 -05:00
Daniel Pfeifer 615e2a17e4 cmCommand: Don't prefix error message with command name
Instead, prefix the error message at the two places where the errors are
handled: cmMakefile and cmCTestHandlerCommand.
2017-02-13 20:49:20 +01:00
Daniel Pfeifer c3800e5458 cmAlgorithms: add cmEraseIf function 2017-02-10 23:04:32 +01:00
Ed Branch 7c8ab7ddc8 add_custom_{command,target}: Add COMMAND_EXPAND_LISTS option
This option allows lists generated by generator expressions to be expanded.

Closes: #15935
2017-01-13 20:02:16 -06:00
Brad King 8e4d286e7b Fix typo in error message on missing required variable
Reported-by: Albrecht Schlosser <AlbrechtS.fltk@online.de>
2016-12-16 09:20:32 -05:00
Daniel Pfeifer a74e689348 clang-tidy: apply readability-redundant-string-init fixes 2016-12-12 14:04:13 -05:00
Brad King a0d64ecf8b Merge topic 'try_compile-lang-std'
f72ba42b try_compile: Add policy CMP0067 to honor language standards
45aa03b9 try_compile: Add options to specify language standards
3bb2051e try_compile: Stop processing when test build system fails to generate
2016-12-07 09:22:22 -05:00
Brad King 3bb2051eef try_compile: Stop processing when test build system fails to generate
Failing to generate the build system of the test project is a failure to
compute the result of the test compilation, and so must be treated as
any other CMake Error and stop processing.
2016-12-06 08:58:37 -05:00
Brad King ae1a6815b6 Features: Add infrastructure for C++ 17 language standard
Issue: #16468
2016-12-02 11:22:46 -05:00
Robert Maynard 5b20d0abfa CUDA: C++ compile features now enable cuda c++11 support. 2016-11-14 11:36:44 -05:00
Daniel Pfeifer 2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Daniel Pfeifer c401f95888 Remove cmCommand::Enabled and all related accessors
Enabled is never set to false.  Remove the member variable and all
related getters and setters.
2016-10-24 10:19:09 -04:00
Stephen Kelly e0a84904eb cmState: Split auxiliary classes into separate files
Port dependents to the new locations as needed.

Leave behind a cmState.h include in cmListFileCache to reduce noise. It
is removed in a following commit.
2016-10-19 15:40:59 +02:00
Stephen Kelly a91eaf3872 cmState: Port dependents to new cmStateTypes header 2016-10-19 15:40:59 +02:00
Stephen Kelly cde6eb6249 cmState: Port dependent code to new cmStateSnapshot name 2016-10-19 15:40:59 +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
Brad King 1e6aaefdee Merge topic 'clean-up-link-configuration'
a1cfc4fe cmMakefile: Simplify programmer error to an assert
4079ba20 cmMakefile: Implement LinkLibraries as an internal property
17ab8e33 cmMakefile: Inline method into only remaining caller
7edfcd0e cmMakefile: Inline method into caller
6c8dc7f1 cmake: Simplify find-package mode library addition
1efca9f4 cmMakefile: Remove obsolete parameter
d9b5f0a3 cmTarget: Remove target name from parameter list
1c70c6cc cmMakefile: Use public API to find a target
2b7baed7 cmMakefile: Inline method into only caller
7ba95492 cmMakefile: Use public API to find a target
6d98b15f cmMakefile: Invert if() condition to remove else
869037ee cmMakefile: Remove ALIAS check
2f6462a6 cmMakefile: Collapse two consecutive if()s into one
148b83a1 cmMakefile: DeMorgan-invert condition
4457a9f1 cmMakefile: Return after error and remove else condition
4d039c5b cmMakefile: Invert handling of error condition
...
2016-10-10 10:23:45 -04:00
Stephen Kelly 267e02097e cmMakefile: Remove pointless condition
This method is never called with an empty string.
2016-10-09 10:47:44 +02:00
Stephen Kelly a1cfc4fe3d cmMakefile: Simplify programmer error to an assert 2016-10-07 22:08:03 +02:00