summaryrefslogtreecommitdiffstats
path: root/Help/command/define_property.rst
blob: da2631c0908515e15777e325318b7e9c0b1daa52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
define_property
---------------

Define and document custom properties.

::

  define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
                   TEST | VARIABLE | CACHED_VARIABLE>
                   PROPERTY <name> [INHERITED]
                   BRIEF_DOCS <brief-doc> [docs...]
                   FULL_DOCS <full-doc> [docs...])

Define one property in a scope for use with the :command:`set_property` and
:command:`get_property` commands.  This is primarily useful to associate
documentation with property names that may be retrieved with the
:command:`get_property` command. The first argument determines the kind of
scope in which the property should be used.  It must be one of the
following:

::

  GLOBAL    = associated with the global namespace
  DIRECTORY = associated with one directory
  TARGET    = associated with one target
  SOURCE    = associated with one source file
  TEST      = associated with a test named with add_test
  VARIABLE  = documents a CMake language variable
  CACHED_VARIABLE = documents a CMake cache variable

Note that unlike :command:`set_property` and :command:`get_property` no
actual scope needs to be given; only the kind of scope is important.

The required ``PROPERTY`` option is immediately followed by the name of
the property being defined.

If the ``INHERITED`` option is given, then the :command:`get_property` command
will chain up to the next higher scope when the requested property is not set
in the scope given to the command.

* ``DIRECTORY`` scope chains to its parent directory's scope, continuing the
  walk up parent directories until a directory has the property set or there
  are no more parents.  If still not found at the top level directory, it
  chains to the ``GLOBAL`` scope.
* ``TARGET``, ``SOURCE`` and ``TEST`` properties chain to ``DIRECTORY`` scope,
  including further chaining up the directories, etc. as needed.

Note that this scope chaining behavior only applies to calls to
:command:`get_property`, :command:`get_directory_property`,
:command:`get_target_property`, :command:`get_source_file_property` and
:command:`get_test_property`.  There is no inheriting behavior when *setting*
properties, so using ``APPEND`` or ``APPEND_STRING`` with the
:command:`set_property` command will not consider inherited values when working
out the contents to append to.

The ``BRIEF_DOCS`` and ``FULL_DOCS`` options are followed by strings to be
associated with the property as its brief and full documentation.
Corresponding options to the :command:`get_property` command will retrieve
the documentation.
it/cpython.git/log/Lib/MimeWriter.py?h=2.7&id=6cea6933625910298c5fb156f365814eb3600494'>logstatsplain -rw-r--r--Queue.py5880logstatsplain -rw-r--r--SimpleHTTPServer.py6426logstatsplain -rw-r--r--SimpleXMLRPCServer.py17548logstatsplain -rw-r--r--SocketServer.py18408logstatsplain -rw-r--r--StringIO.py10608logstatsplain -rw-r--r--UserDict.py5572logstatsplain -rw-r--r--UserList.py3539logstatsplain -rwxr-xr-xUserString.py7963logstatsplain -rw-r--r--_LWPCookieJar.py6814logstatsplain -rw-r--r--_MozillaCookieJar.py5608logstatsplain -rw-r--r--__future__.py3405logstatsplain -rw-r--r--__phello__.foo.py64logstatsplain -rw-r--r--_strptime.py18778logstatsplain -rw-r--r--_threading_local.py6559logstatsplain -rw-r--r--aifc.py33330logstatsplain -rw-r--r--anydbm.py2620logstatsplain -rw-r--r--asynchat.py10756logstatsplain -rw-r--r--asyncore.py16773logstatsplain -rw-r--r--atexit.py1631logstatsplain -rw-r--r--audiodev.py7477logstatsplain -rwxr-xr-xbase64.py11197logstatsplain -rw-r--r--bdb.py20016logstatsplain -rw-r--r--binhex.py15067logstatsplain -rw-r--r--bisect.py2365logstatsplain d---------bsddb293logstatsplain -rw-r--r--calendar.py7659logstatsplain -rwxr-xr-xcgi.py34262logstatsplain -rw-r--r--cgitb.py12035logstatsplain -rw-r--r--chunk.py5372logstatsplain -rw-r--r--cmd.py14962logstatsplain -rw-r--r--code.py9968logstatsplain -rw-r--r--codecs.py23133logstatsplain -rw-r--r--codeop.py6145logstatsplain -rw-r--r--colorsys.py3185logstatsplain -rw-r--r--commands.py2279logstatsplain -rw-r--r--compileall.py5283logstatsplain d---------compiler415logstatsplain -rw-r--r--cookielib.py63358logstatsplain -rw-r--r--copy.py11022logstatsplain -rw-r--r--copy_reg.py6244logstatsplain -rw-r--r--csv.py15946logstatsplain d---------curses225logstatsplain -rw-r--r--dbhash.py404logstatsplain -rw-r--r--decimal.py104109logstatsplain -rw-r--r--difflib.py79270logstatsplain -rw-r--r--dircache.py1006logstatsplain -rw-r--r--dis.py6484logstatsplain d---------distutils1126logstatsplain -rw-r--r--doctest.py99482logstatsplain -rw-r--r--dumbdbm.py8365logstatsplain -rw-r--r--dummy_thread.py4284logstatsplain -rw-r--r--dummy_threading.py2900logstatsplain d---------email867logstatsplain d---------encodings4229logstatsplain -rw-r--r--filecmp.py9471logstatsplain -rw-r--r--fileinput.py12373logstatsplain -rw-r--r--fnmatch.py3019logstatsplain -rw-r--r--formatter.py14954logstatsplain -rw-r--r--fpformat.py4579logstatsplain -rw-r--r--ftplib.py26810logstatsplain -rw-r--r--getopt.py7316logstatsplain -rw-r--r--getpass.py3122logstatsplain -rw-r--r--gettext.py19230logstatsplain -rw-r--r--glob.py1441logstatsplain -rw-r--r--gopherlib.py5592logstatsplain -rw-r--r--gzip.py16161logstatsplain -rw-r--r--heapq.py14339logstatsplain -rw-r--r--hmac.py3348logstatsplain d---------hotshot146logstatsplain -rw-r--r--htmlentitydefs.py18054logstatsplain -rw-r--r--htmllib.py12740logstatsplain -rw-r--r--httplib.py45360logstatsplain d---------idlelib2860logstatsplain -rw-r--r--ihooks.py17335logstatsplain