Commit Graph

21 Commits

Author SHA1 Message Date
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
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
Brad King 0ac18d40c8 Remove `//------...` horizontal separator comments
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:

    $ git ls-files -z -- \
        "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
      egrep -z -v "^Source/cmCommandArgumentLexer\." |
      egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmDependsJavaLexer\." |
      egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmExprLexer\." |
      egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmFortranLexer\." |
      egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmListFileLexer\." |
      egrep -z -v "^Source/cm_sha2" |
      egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
      egrep -z -v "^Utilities/(KW|cm).*/" |
      xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'

This avoids modifying third-party sources and generated sources.
2016-05-09 09:41:43 -04:00
Gregor Jasny 5790aca4ad target_include_directories: Support relative SYSTEM include dirs (#15464) 2015-08-11 08:53:00 -04:00
Stephen Kelly c7b39d06f9 cmMakefile: Split accessors for include directories and origins. 2015-07-22 20:25:47 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Brad King dd6c596c12 Merge topic 'join-algorithm'
55a73e6b Use the cmJoin algorithm where possible.
8dc8d756 cmStandardIncludes: Add a join algorithm for string containers.
b5813cee cmInstallCommand: Remove unused variable.
2015-01-12 09:41:02 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Stephen Kelly 55a73e6b1f Use the cmJoin algorithm where possible. 2015-01-08 22:28:18 +01:00
Ben Boeckel d46c650d67 cmMakefile: return a backtrace
This allows backtraces to be fully controlled by the makefile rather
than externally (and makes changing how they are manipulated easier).
2014-06-05 12:44:04 -04:00
Stephen Kelly 4e6ca50445 cmTargetPropCommandBase: Change the interface to return bool.
This is needed for the target_compile_features command, which
may fail at configure time if an invalid feature is specified.
2014-04-07 18:11:18 +02:00
Stephen Kelly 907c09cd31 include_directory: Add missing include.
The cmGeneratorExpression is used here, but the header for it is not
in the include heirarchy.  This would be a compile error if the file
were compiled as a standalone translation unit, but it is instead
used in a mini-unity-build by inclusion in cmCommands.cxx. The header
for cmGeneratorExpression happens to be included first, so the
compilation works fine.

IDEs do not know this however, and flag the use as an error.
2014-02-17 11:08:58 +01:00
Stephen Kelly 38afc82e76 target_include_directories: Allow relative path with genex
Treat paths which are relative and which contain a generator
expression which is not at the beginning as relative to the
source directory.

This matches the behavior of paths which are relative but contain
no generator expression at all.

Previously this would generate a relative path with the IMPORTED
target on export(), which would be a reported as a non-existent
path on import. If used directly in the buildsystem, it would be
reported as a relative path, which is also an error. There is no
need for a policy in this case.
2013-11-26 10:30:18 +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 1925cffa08 Add a SYSTEM parameter to target_include_directories (#14180)
This is similar to the include_directories(SYSTEM) signature
in that it allows telling the compiler to ignore warnings from
such headers.
2013-07-02 16:40:03 +02:00
Stephen Kelly 5b88504f65 Rename the IncludeDirectoriesEntry to be more generic. 2013-02-12 10:39:35 +01:00
Stephen Kelly 92e98dd909 Deduplicate the isGeneratorExpression method.
This API seems like the most appropriate.
2013-02-07 16:21:08 +01:00
Stephen Kelly 7bf490e9bb Make subclasses responsible for joining content.
This way we can add handling of relative/absolute paths and of
-D in compile definitions.
2013-01-29 19:34:04 +01:00
Stephen Kelly f6b16d4b06 Don't allow targets args in the new target commands. 2013-01-29 18:44:54 +01:00
Stephen Kelly b98d14d400 Disallow porcelain to populate includes and defines of IMPORTED targets.
With similar reasoning to the parent commit, as downstreams, we can't
determine what $<CONFIG> generator expressions would be appropriate.

Upstream would have populated the INTERFACE_INCLUDE_DIRECTORIES with
config-specific generator expressions, possibly appropriate for
their DEBUG_CONFIGURATIONS. In theory, if we would add include
directories for a DEBUG intent, we would have to match the upstream
configurations for that.

Rather than attempting to discover the appropriate configurations
at this time, simplify the feature instead. The use of IMPORTED targets
with these commands could still be added in the future if targets
would export their DEBUG_CONFIGURATIONS somehow.
2013-01-21 12:32:46 +01:00
Stephen Kelly 8a37ebec78 Add the target_include_directories command.
This is a convenience API to populate the corresponding properties.
2013-01-10 09:46:57 -05:00