kpa library
This section contains a description of commands of the CMake
library kpa
, which is intended for building KPA packages.
add_kpa_package()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/kpa.cmake
.
The command creates a CMake
target for building the KPA package. When building this target, the build process automatically creates the KPA package manifest and the KPA package, which includes all components that were added to this target using the CMake
command add_kpa_component().
Parameters:
KPA_TARGET_NAME
– name of theCMake
target. Required parameter.MANIFEST_V
– version of the KPA package manifest. Required parameter. It must be set to2
.VERSION
– version of the KPA package. The default value isPROJECT_VERSION
.ID
– ID of the KPA package. The default value isKPA_TARGET_NAME
.DEVELOPER_ID
– identifier of the developer. The default value is"unspecified"
.DONT_VERIFY
—if this parameter is defined, verification of the presence of all KPA package components specified in its manifest and the absence of unspecified components, and calculation of the checksums of KPA package components and their comparison with those specified in the KPA package manifest will not be performed.
Properties of the created CMake
target:
KPA_OUTPUT_DIR
– directory in which the KPA package will be put.KPA_OUTPUT_NAME
– name of the KPA file without the file extension. The default value is${DEVELOPER_ID}.${ID}
.
Example call:
add_kpa_component()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/kpa.cmake
.
The command adds the component to the specified CMake
target for building the KPA package. This command can be called multiple times for the same KPA package build target. A KPA package build target is created by the add_kpa_package() command.
Parameters:
PACKAGE_NAME
– name of theCMake
target for building the KPA package. Required parameter.MODE
– type of component. Required parameter. The following values are possible:LIBRARY
– the component is a dynamic library. You must specify the full path to the file or the name of theCMake
target. It is put into the directory/<package_name>/lib
when the KPA package is installed.FILES
– the component is a file. You must specify the full path to the file. When a KPA package is installed, it is put into the/<package_name>/res
directory.DIRECTORY
– the component is a directory containing files. You must specify the full path to the directory. When a KPA package is installed, it is put into the/<package_name>/res
directory.RUN_CONFIGURATION
– the component is a program run configuration. You must specify the following parameters:ID
– startup configuration ID that is unique within the KPA package. Required parameter.NAME
– startup configuration name. Required parameter.TYPE
– type of run configuration:"gui"
– process with a graphical user interface or"service"
– endpoint process. Required parameter.PATH
– full path to the executable file of the component after KPA package installation relative to the/<package_name>
directory.EIID
– security class of the program. Required parameter.PRIMARY
– indicates whether the startup configuration is the primary one during program startup.AUTORUN
– indicates whether this configuration is started automatically.ARGS
– list of command-line arguments in the form of a string array for starting the program.ENV
– list of environment variables for starting the program.
RESOURCE
– used for adding arbitrary data to the KPA package. You must specify the following parameters:- Full path to the file or directory containing the data. Required parameter.
- In the
TYPE
parameter, specify the data type:"res"
,"bin"
,"lib"
or"manifestLocale"
. Required parameter. For more details, refer to List of "components" objects. - (Optional) In the
DIRECTORY_PATH
parameter, specify the path to the directory where the data will be put after KPA package installation; the specified path should be relative to the/<package_name>/res
directory.
Example calls: