KasperskyOS Community Edition 1.3

add_kpa_component()

This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/kpa.cmake.

add_kpa_component(PACKAGE_NAME MODE ...)

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 the CMake 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 the CMake 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:

include (platform/kpa) # Add the program executable file add_kpa_component(Hello.kpa RESOURCE ".build/aarch64-kos-debug/hello/Hello" TYPE "bin" DIRECTORY_PATH "bin/") Adding program startup configuration add_kpa_component(Hello.kpa RUN_CONFIGURATION "app" NAME "Hello app" TYPE "service" EIID "hello.Hello" PATH "bin/Hello")