diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-09 08:01:46 (GMT) |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-28 16:32:54 (GMT) |
commit | ead71873b2025a28df1208bbd3f2f8e1918a120c (patch) | |
tree | 70643100c7c4ff79d3535f987028d1a7a618354b /Help | |
parent | 8f25f37676cb860348738eff4dfb1c3b8bae0b59 (diff) | |
download | CMake-ead71873b2025a28df1208bbd3f2f8e1918a120c.zip CMake-ead71873b2025a28df1208bbd3f2f8e1918a120c.tar.gz CMake-ead71873b2025a28df1208bbd3f2f8e1918a120c.tar.bz2 |
server-mode: Report information relevant for a codemodel
Add "codemodel" command to report information relevant to feed a code
model.
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-server.7.rst | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst index b8a425c..79b67b0 100644 --- a/Help/manual/cmake-server.7.rst +++ b/Help/manual/cmake-server.7.rst @@ -374,3 +374,187 @@ CMake will reply (after reporting progress information):: [== CMake Server ==[ {"cookie":"","inReplyTo":"compute","type":"reply"} ]== CMake Server ==] + + +Type "codemodel" +^^^^^^^^^^^^^^^^ + +The "codemodel" request can be used after a project was "compute"d successfully. + +It will list the complete project structure as it is known to cmake. + +The reply will contain a key "projects", which will contain a list of +project objects, one for each (sub-)project defined in the cmake build system. + +Each project object can have the following keys: + +"name" + contains the (sub-)projects name. +"sourceDirectory" + contains the current source directory +"buildDirectory" + contains the current build directory. +"configurations" + contains a list of configuration objects. + +Configuration objects are used to destinquish between different +configurations the build directory might have enabled. While most generators +only support one configuration, others support several. + +Each configuration object can have the following keys: + +"name" + contains the name of the configuration. The name may be empty. +"targets" + contains a list of target objects, one for each build target. + +Target objects define individual build targets for a certain configuration. + +Each target object can have the following keys: + +"name" + contains the name of the target. +"type" + defines the type of build of the target. Possible values are + "STATIC_LIBRARY", "MODULE_LIBRARY", "SHARED_LIBRARY", "OBJECT_LIBRARY", + "EXECUTABLE", "UTILITY" and "INTERFACE_LIBRARY". +"fullName" + contains the full name of the build result (incl. extensions, etc.). +"sourceDirectory" + contains the current source directory. +"buildDirectory" + contains the current build directory. +"artifacts" + with a list of build artifacts. The list is sorted with the most + important artifacts first (e.g. a .DLL file is listed before a + .PDB file on windows). +"linkerLanguage" + contains the language of the linker used to produce the artifact. +"linkLibraries" + with a list of libraries to link to. This value is encoded in the + system's native shell format. +"linkFlags" + with a list of flags to pass to the linker. This value is encoded in + the system's native shell format. +"linkLanguageFlags" + with the flags for a compiler using the linkerLanguage. This value is + encoded in the system's native shell format. +"frameworkPath" + with the framework path (on Apple computers). This value is encoded + in the system's native shell format. +"linkPath" + with the link path. This value is encoded in the system's native shell + format. +"sysroot" + with the sysroot path. +"fileGroups" + contains the source files making up the target. + +FileGroups are used to group sources using similar settings together. + +Each fileGroup object may contain the following keys: + +"language" + contains the programming language used by all files in the group. +"compileFlags" + with a string containing all the flags passed to the compiler + when building any of the files in this group. This value is encoded in + the system's native shell format. +"includePath" + with a list of include paths. Each include path is an object + containing a "path" with the actual include path and "isSystem" with a bool + value informing whether this is a normal include or a system include. This + value is encoded in the system's native shell format. +"defines" + with a list of defines in the form "SOMEVALUE" or "SOMEVALUE=42". This + value is encoded in the system's native shell format. +"sources" + with a list of source files. + +All file paths in the fileGroup are either absolute or relative to the +sourceDirectory of the target. + +Example:: + + [== CMake Server ==[ + {"type":"project"} + ]== CMake Server ==] + +CMake will reply:: + + [== CMake Server ==[ + { + "cookie":"", + "type":"reply", + "inReplyTo":"project", + + "projects": + [ + { + "name":"CMAKE_FORM", + "sourceDirectory":"/home/code/src/cmake/Source/CursesDialog/form" + "buildDirectory":"/tmp/cmake-build-test/Source/CursesDialog/form", + "configurations": + [ + { + "name":"", + "targets": + [ + { + "artifactDirectory":"/tmp/cmake/Source/CursesDialog/form", + "fileGroups": + [ + { + "compileFlags":" -std=gnu11", + "defines": + [ + "SOMETHING=1", + "LIBARCHIVE_STATIC" + ], + "includePath": + [ + { "path":"/tmp/cmake-build-test/Utilities" }, + { "isSystem": true, "path":"/usr/include/something" }, + ... + ] + "language":"C", + "sources": + [ + "fld_arg.c", + ... + "fty_regex.c" + ] + } + ], + "fullName":"libcmForm.a", + "linkerLanguage":"C", + "name":"cmForm", + "type":"STATIC_LIBRARY" + } + ] + } + ], + }, + ... + ] + } + ]== CMake Server ==] + +The output can be tailored to the specific needs via parameter passed when +requesting "project" information. + +You can have a "depth" key, which accepts "project", "configuration" and +"target" as string values. These cause the output to be trimmed at the +appropriate depth of the output tree. + +You can also set "configurations" to an array of strings with configuration +names to list. This will cause any configuration that is not listed to be +trimmed from the output. + +Generated files can be included in the listing by setting "includeGeneratedFiles" +to "true". This setting defaults to "false", so generated files are not +listed by default. + +Finally you can limit the target types that are going to be listed. This is +done by providing a list of target types as an array of strings to the +"targetTypes" key. |