Merge topic 'fileapi-codemodel-directory'

049bf98f63 fileapi: Add installers to codemodel-v2 "directory" object
eae2256a52 fileapi: Add backtraceGraph to codemodel-v2 "directory" object
a12d7f70b1 fileapi: Add a "directory" object to codemodel-v2
fd30bd93e6 fileapi: Re-organize backtrace infrastructure
415ead8153 cmFileAPICodemodel: Build map from each target to its index
f73b6879e9 cmInstallTargetGenerator: Report namelink mode with list of files
ea430582f9 cmInstallTargetGenerator: Drop unused GetNamelinkMode method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5917
This commit is contained in:
Brad King
2021-03-18 13:41:53 +00:00
committed by Kitware Robot
26 changed files with 1640 additions and 136 deletions
+222 -29
View File
@@ -443,7 +443,8 @@ Version 1 does not exist to avoid confusion with that from
"hasInstallRule": true,
"minimumCMakeVersion": {
"string": "3.14"
}
},
"jsonFile": "<file>"
},
{
"source": "sub",
@@ -453,7 +454,8 @@ Version 1 does not exist to avoid confusion with that from
"targetIndexes": [ 1 ],
"minimumCMakeVersion": {
"string": "3.14"
}
},
"jsonFile": "<file>"
}
],
"projects": [
@@ -569,6 +571,13 @@ The members specific to ``codemodel`` objects are:
:command:`install` rules, i.e. whether a ``make install``
or equivalent rule is available.
``jsonFile``
A JSON string specifying a path relative to the codemodel file
to another JSON file containing a
`"codemodel" version 2 "directory" object`_.
This field was added in codemodel version 2.3.
``projects``
A JSON array of entries corresponding to the top-level project
and sub-projects defined in the build system. Each (sub-)project
@@ -633,6 +642,182 @@ The members specific to ``codemodel`` objects are:
to another JSON file containing a
`"codemodel" version 2 "target" object`_.
"codemodel" version 2 "directory" object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A codemodel "directory" object is referenced by a `"codemodel" version 2`_
object's ``directories`` array. Each "directory" object is a JSON object
with members:
``paths``
A JSON object containing members:
``source``
A string specifying the path to the source directory, represented
with forward slashes. If the directory is inside the top-level
source directory then the path is specified relative to that
directory (with ``.`` for the top-level source directory itself).
Otherwise the path is absolute.
``build``
A string specifying the path to the build directory, represented
with forward slashes. If the directory is inside the top-level
build directory then the path is specified relative to that
directory (with ``.`` for the top-level build directory itself).
Otherwise the path is absolute.
``installers``
A JSON array of entries corresponding to :command:`install` rules.
Each entry is a JSON object containing members:
``component``
A string specifying the component selected by the corresponding
:command:`install` command invocation.
``destination``
Optional member that is present for specific ``type`` values below.
The value is a string specifying the install destination path.
The path may be absolute or relative to the install prefix.
``paths``
Optional member that is present for specific ``type`` values below.
The value is a JSON array of entries corresponding to the paths
(files or directories) to be installed. Each entry is one of:
* A string specifying the path from which a file or directory
is to be installed. The portion of the path not preceded by
a ``/`` also specifies the path (name) to which the file
or directory is to be installed under the destination.
* A JSON object with members:
``from``
A string specifying the path from which a file or directory
is to be installed.
``to``
A string specifying the path to which the file or directory
is to be installed under the destination.
In both cases the paths are represented with forward slashes. If
the "from" path is inside the top-level directory documented by the
corresponding ``type`` value, then the path is specified relative
to that directory. Otherwise the path is absolute.
``type``
A string specifying the type of installation rule. The value is one
of the following, with some variants providing additional members:
``file``
An :command:`install(FILES)` or :command:`install(PROGRAMS)` call.
The ``destination`` and ``paths`` members are populated, with paths
under the top-level *source* directory expressed relative to it.
The ``isOptional`` member may exist.
This type has no additional members.
``directory``
An :command:`install(DIRECTORY)` call.
The ``destination`` and ``paths`` members are populated, with paths
under the top-level *source* directory expressed relative to it.
The ``isOptional`` member may exist.
This type has no additional members.
``target``
An :command:`install(TARGETS)` call.
The ``destination`` and ``paths`` members are populated, with paths
under the top-level *build* directory expressed relative to it.
The ``isOptional`` member may exist.
This type has additional members ``targetId``, ``targetIndex``,
``targetIsImportLibrary``, and ``targetInstallNamelink``.
``export``
An :command:`install(EXPORT)` call.
The ``destination`` and ``paths`` members are populated, with paths
under the top-level *build* directory expressed relative to it.
The ``paths`` entries refer to files generated automatically by
CMake for installation, and their actual values are considered
private implementation details.
This type has additional members ``exportName`` and ``exportTargets``.
``script``
An :command:`install(SCRIPT)` call.
This type has additional member ``scriptFile``.
``code``
An :command:`install(CODE)` call.
This type has no additional members.
``isExcludeFromAll``
Optional member that is present with boolean value ``true`` when
:command:`install` is called with the ``EXCLUDE_FROM_ALL`` option.
``isOptional``
Optional member that is present with boolean value ``true`` when
:command:`install` is called with the ``OPTIONAL`` option.
This is allowed when ``type`` is ``file``, ``directory``, or ``target``.
``targetId``
Optional member that is present when ``type`` is ``target``.
The value is a string uniquely identifying the target to be installed.
This matches the ``id`` member of the target in the main
"codemodel" object's ``targets`` array.
``targetIndex``
Optional member that is present when ``type`` is ``target``.
The value is an unsigned integer 0-based index into the main "codemodel"
object's ``targets`` array for the target to be installed.
``targetIsImportLibrary``
Optional member that is present when ``type`` is ``target`` and
the installer is for a Windows DLL import library file or for an
AIX linker import file. If present, it has boolean value ``true``.
``targetInstallNamelink``
Optional member that is present when ``type`` is ``target`` and
the installer corresponds to a target that may use symbolic links
to implement the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION`
target properties.
The value is a string indicating how the installer is supposed to
handle the symlinks: ``skip`` means the installer should skip the
symlinks and install only the real file, and ``only`` means the
installer should install only the symlinks and not the real file.
In all cases the ``paths`` member lists what it actually installs.
``exportName``
Optional member that is present when ``type`` is ``export``.
The value is a string specifying the name of the export.
``exportTargets``
Optional member that is present when ``type`` is ``export``.
The value is a JSON array of entries corresponding to the targets
included in the export. Each entry is a JSON object with members:
``id``
A string uniquely identifying the target. This matches
the ``id`` member of the target in the main "codemodel"
object's ``targets`` array.
``index``
An unsigned integer 0-based index into the main "codemodel"
object's ``targets`` array for the target.
``scriptFile``
Optional member that is present when ``type`` is ``script``.
The value is a string specifying the path to the script file on disk,
represented with forward slashes. If the file is inside the top-level
source directory then the path is specified relative to that directory.
Otherwise the path is absolute.
``backtrace``
Optional member that is present when a CMake language backtrace to
the :command:`install` or other command invocation that added this
installer is available. The value is an unsigned integer 0-based
index into the ``backtraceGraph`` member's ``nodes`` array.
``backtraceGraph``
A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
from ``backtrace`` members elsewhere in this "directory" object.
"codemodel" version 2 "target" object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -964,40 +1149,48 @@ with members:
with forward slashes.
``backtraceGraph``
A JSON object describing the graph of backtraces whose nodes are
referenced from ``backtrace`` members elsewhere. The members are:
A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
from ``backtrace`` members elsewhere in this "target" object.
``nodes``
A JSON array listing nodes in the backtrace graph. Each entry
is a JSON object with members:
"codemodel" version 2 "backtrace graph"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``file``
An unsigned integer 0-based index into the backtrace ``files`` array.
The ``backtraceGraph`` member of a `"codemodel" version 2 "directory" object`_,
or `"codemodel" version 2 "target" object`_ is a JSON object describing a
graph of backtraces. Its nodes are referenced from ``backtrace`` members
elsewhere in the containing object. The backtrace graph object members are:
``line``
An optional member present when the node represents a line within
the file. The value is an unsigned integer 1-based line number.
``nodes``
A JSON array listing nodes in the backtrace graph. Each entry
is a JSON object with members:
``command``
An optional member present when the node represents a command
invocation within the file. The value is an unsigned integer
0-based index into the backtrace ``commands`` array.
``file``
An unsigned integer 0-based index into the backtrace ``files`` array.
``parent``
An optional member present when the node is not the bottom of
the call stack. The value is an unsigned integer 0-based index
of another entry in the backtrace ``nodes`` array.
``line``
An optional member present when the node represents a line within
the file. The value is an unsigned integer 1-based line number.
``commands``
A JSON array listing command names referenced by backtrace nodes.
Each entry is a string specifying a command name.
``command``
An optional member present when the node represents a command
invocation within the file. The value is an unsigned integer
0-based index into the backtrace ``commands`` array.
``files``
A JSON array listing CMake language files referenced by backtrace nodes.
Each entry is a string specifying the path to a file, represented
with forward slashes. If the file is inside the top-level source
directory then the path is specified relative to that directory.
Otherwise the path is absolute.
``parent``
An optional member present when the node is not the bottom of
the call stack. The value is an unsigned integer 0-based index
of another entry in the backtrace ``nodes`` array.
``commands``
A JSON array listing command names referenced by backtrace nodes.
Each entry is a string specifying a command name.
``files``
A JSON array listing CMake language files referenced by backtrace nodes.
Each entry is a string specifying the path to a file, represented
with forward slashes. If the file is inside the top-level source
directory then the path is specified relative to that directory.
Otherwise the path is absolute.
Object Kind "cache"
-------------------
@@ -0,0 +1,10 @@
fileapi-codemodel-directory
---------------------------
* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
component been updated to 2.3.
* The :manual:`cmake-file-api(7)` "codemodel" version 2 gained a
new "directory" object containing directory-level information.
This includes a list of installers generated by the :command:`install`
command.