Commit Graph

19 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Peter Kokot
fb4d5f34fd
CMakePrintHelpers: Enhance documentation
- Commands listed in the usual docs style
- Examples moved to a separate section after the signatures and output
  example added for the target properties
2025-01-18 11:02:12 +01:00
FeRD (Frank Dana)
b7ddfcfe08 cmake_print_properties(): Update grammar docs 2022-06-06 12:27:11 -04:00
FeRD (Frank Dana)
e52b9e1270 PrintHelpers: Document argument order restriction 2022-06-06 12:27:11 -04:00
FeRD (Frank Dana)
d87ed4d88f PrintHelpers: Fix indentation 2022-06-06 12:27:11 -04:00
FeRD (Frank Dana)
5fa70e1738 PrintHelpers: Rewrite a few more error messages 2022-06-06 12:27:09 -04:00
FeRD (Frank Dana)
2579503f45 PrintHelpers: Fix target SOURCES property
It's been a long-standing bug in CMakePrintHelpers that the
cmake_print_properties() function cannot print the SOURCES
property of a requested TARGET, confusing it with a request
to print properties of SOURCES.

We work around this by parsing the arguments in two stages,
so that a SOURCES that comes after the PROPERTIES keyword
is handled differently from a SOURCES that comes before it.

This adds the restriction that the "mode" keyword (TARGETS
SOURCES DIRECTORIES etc...) and its arguments **must** precede
the PROPERTIES keyword and its arguments. In other words:

1. Both of these are now valid and will be interpreted correctly,
   whereas previously only the first was, and the second caused
   a FATAL_ERROR:

   cmake_print_properties(SOURCES foo.c PROPERTIES LANGUAGE)
   cmake_print_properties(TARGETS foo PROPERTIES SOURCES)

2. This, OTOH, which used to be valid, no longer is, and will
   trigger a FATAL_ERROR:

   cmake_print_properties(PROPERTIES LANGUAGE SOURCES foo.c)

Fixes: #14883
2022-06-06 12:25:51 -04:00
Kyle Edwards
bb9a701a2b CMakePrintHelpers: Work around CACHE argument of set()
Fixes: #21919
2021-03-11 08:55:05 -05:00
Craig Scott
fea940eb86 Help: Fix minor typo in CMakePrintHelpers module docs
Fixes: #19900
2019-10-31 10:24:17 +11:00
Kitware Robot
932dcce1e6 Modules: Consistently use 2 space indentation 2019-05-14 15:26:46 -04:00
Joachim Wuttke (h)
1c94129e98 Help: correct macro -> function in CMakePrintHelpers
and apply lower case throughout
2018-11-11 23:18:37 +01:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Daniel Pfeifer
d6877e6c40 Don't include CMakeParseArguments
The cmake_parse_arguments command is builtin with version 3.5.
The CMakeParseArguments module is empty and exists for backwards
compatibility with CMake 3.4 and lower.

Remove the includes of CMakeParseArguments from CMake's modules.
The modules are always used with the current version of CMake.

Leave the includes in the tests, as the tests may be run with an older
version of CMake.
2017-01-11 13:14:57 +01: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
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:41:13 +02:00
Brad King
58b2d760ee Modules: Format documentation to avoid over-long preformatted lines
Convert several preformatted code block literals that enumerate lists of
options or variables to use reST definition lists instead.  Manually
wrap other long lines in code blocks.
2014-10-22 15:52:31 -04:00
Stephen Kelly
efc43cde8f Help: Fix some erroneous code block markers in Module docs.
There are many style errors in these files. This patch fixes only
the syntactical errors.

The script which ported these to rst tripped on some incorrectly
formatted blocks in the original input documentation.  Use a new
script to find problematic code (and then fix them manually):

  #!/usr/bin/env python

  import os

  rootDir = '.'

  def checkFile(fname):

    f = open(fname)
    lines = f.readlines()
    started = False
    counter = 0
    for l in lines:
      if "#" in l:
        started = True
      elif started:
        return
      lin = l.find("(")
      if lin != -1 and l.find(")", lin) == -1 and \
          not "(To distribute this file outside of CMake, substitute the full" in l:
        for lp in lines[counter+1:]:
          if lp == "# ::\n":
            print "\n\n######### " + fname + "\n\n"
            print ''.join(lines[max(counter-2, 0):counter+6])
            break
          elif lp == "#\n" :
            continue
          break
      counter += 1

  for dirName, subdirList, fileList in os.walk(rootDir):
      for fname in fileList:
          checkFile(os.path.join(dirName, fname))
2014-01-07 09:52:56 -05:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Alex Neundorf
e32ff9666c add macros cmake_print_properties() and cmake_print_variables()
This patch adds the file CMakePrintHelpers.cmake, which provides
the macros (functions) cmake_print_properties() and cmake_print_variables(),
which are useful e.g. for debugging and make inspecting target (or other)
properties easier.

Alex
2013-07-27 21:37:05 +02:00