Unit 'fpmkunit' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#fcl]

TPackage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Central class for package management and building

Declaration

Source position: fpmkunit.pp line 928

type TPackage = class(TNamedItem)

public

  constructor Create(); override;

  

Creates a new package instance

  destructor destroy; override;

  

Destroys the package instance and frees resources

  function HaveOptions;

  

Checks if package has global compilation options

  function GetUnitsOutputDir(); deprecated ;

  

Returns the output directory for compiled units

  function GetUnitConfigOutputFilename(); deprecated ;

  

Gets output filename for unit configuration file

  function GetBinOutputDir(); deprecated ;

  

Returns the output directory for binary files

  procedure GetCleanFiles(); deprecated ;

  

Gets list of files to be cleaned for the package

  procedure GetArchiveFiles(); deprecated ;

  

Gets list of files to include in package archive

  procedure InheritPackageVariantsFromDependency();

  

Inherits package variants from a dependency package

  function GetPackageVariantsByName();

  

Gets package variants collection by name

  procedure SetUnitsOutputDir();

  

Sets the output directory for compiled units

  function GetPackageUnitInstallDir();

  

Gets installation directory for package units

  procedure SetPackageUnitInstallDir();

  

Sets installation directory for package units

  procedure GetInstallFiles(); virtual;

  

Gets list of files to be installed for the package

  procedure GetInstallSourceFiles(); virtual;

  

Gets list of source files to be installed

  procedure GetArchiveSourceFiles(); virtual;

  

Gets list of source files for package archive

  procedure GetManifest();

  

Gets package manifest information

  procedure ListPackage();

  

Lists package information to a string list

  procedure AddPackageVariant();

  

Adds a package variant to the package

  procedure ApplyPackageVariantToCompilerOptions();

  

Applies package variant settings to compiler options

  procedure SetDefaultPackageVariant;

  

Sets the default package variant for the package

  procedure LoadUnitConfigFromFile();

  

Loads unit configuration from a file

  procedure SaveUnitConfigToFile();

  

Saves unit configuration to a file

  procedure EnterResolveDirsCS;

  

Enters critical section for directory resolution

  procedure LeaveResolveDirsCS;

  

Leaves critical section for directory resolution

  function AddTargetsFromDir();

  procedure ApplyNameSpaces();

  

Applies namespace settings to a filename

  function SubTargetAllowed();

  

Checks if a subtarget is allowed for the package

  property Version: string; [rw]

  

Version string of the package

  property FileName: string; [rw]

  

Filename of the package definition file

  property ShortName: string; [rw]

  

Short name identifier for the package

  property HomepageURL: string; [rw]

  

URL of the package homepage

  property DownloadURL: string; [rw]

  

URL for downloading the package

  property Email: string; [rw]

  

Contact email address for the package

  property Author: string; [rw]

  

Author or maintainer of the package

  property License: string; [rw]

  

License terms for the package

  property Directory: string; [rw]

  

Base directory path of the package

  property Description: string; [rw]

  

Descriptive text about the package

  property DescriptionFile: string; [rw]

  

File containing package description text

  property InstalledChecksum: Cardinal; [rw]

  

Checksum of installed package files

  property IsFPMakeAddIn: Boolean; [rw]

  

Whether this package is an FPMake add-in

  property SupportBuildModes: TBuildModes; [rw]

  

Whether package supports different build modes

  property BuildMode: TBuildMode; [r]

  

Default build mode configuration for the package

  property Flags: TStrings; [r]

  

Package flags and behavior settings

  property PackageVersion: TFPVersion; [r]

  

Version information for the package

  property TransmitOptions: TStrings; [rw]

  

Options transmitted to dependent packages

  property OSes: TOSes; [rw]

  

Supported operating systems for the package

  property CPUs: TCPUS; [rw]

  

Supported CPU architectures for the package

  property SubTargets: TRTLStringDynArray; [rw]

  

Subtarget configurations for the package

  property NeedLibC: Boolean; [rw]

  

Whether package requires C library linkage

  property Options: TStrings; [rw]

  

Compiler options for the package

  property UnitPath: TConditionalStrings; [r]

  

Search paths for unit files

  property ObjectPath: TConditionalStrings; [r]

  

Search paths for object files

  property IncludePath: TConditionalStrings; [r]

  

Search paths for include files

  property SourcePath: TConditionalStrings; [r]

  

Search paths for source files

  property ExamplePath: TConditionalStrings; [r]

  

Search paths for example files

  property TestPath: TConditionalStrings; [r]

  

Search paths for test files

  property FPDocFormat: TFPDocFormats; [rw]

  

Output format for FPDoc documentation

  property InstallFiles: TConditionalDestStrings; [r]

  

Collection of files to be installed

  property CleanFiles: TConditionalStrings; [r]

  

Collection of files to be cleaned

  property Dependencies: TDependencies; [r]

  

Collection of package dependencies

  property Commands: TCommands; [r]

  

Collection of custom build commands

  property State: TTargetState; [rw]

  

Current build state of the package

  property Targets: TTargets; [r]

  

Collection of build targets

  property Sources: TSources; [r]

  

Collection of source files

  property UnitDir: string; [rw]

  

Directory for compiled unit files

  property UnitConfigFileName: string; [rw]

  

Filename for unit configuration file

  property NamespaceMap: string; [rw]

  

Mapping of unit names to namespaces

  property BeforeCompile: TNotifyEvent; [rw]

  

Event handler executed before package compilation

  property BeforeCompileProc: TNotifyProcEvent; [rw]

  

Procedural event handler before compilation

  property AfterCompile: TNotifyEvent; [rw]

  

Event handler executed after package compilation

  property AfterCompileProc: TNotifyProcEvent; [rw]

  

Procedural event handler after compilation

  property BeforeInstall: TNotifyEvent; [rw]

  

Event handler executed before package installation

  property BeforeInstallProc: TNotifyProcEvent; [rw]

  

Procedural event handler before installation

  property AfterInstall: TNotifyEvent; [rw]

  

Event handler executed after package installation

  property AfterInstallProc: TNotifyProcEvent; [rw]

  

Procedural event handler after installation

  property BeforeClean: TNotifyEvent; [rw]

  

Event handler executed before package cleanup

  property BeforeCleanProc: TNotifyProcEvent; [rw]

  

Procedural event handler before cleanup

  property AfterClean: TNotifyEvent; [rw]

  

Event handler executed after package cleanup

  property AfterCleanProc: TNotifyProcEvent; [rw]

  

Procedural event handler after cleanup

  property BeforeArchive: TNotifyEvent; [rw]

  

Event handler executed before package archiving

  property BeforeArchiveProc: TNotifyProcEvent; [rw]

  

Procedural event handler before archiving

  property AfterArchive: TNotifyEvent; [rw]

  

Event handler executed after package archiving

  property AfterArchiveProc: TNotifyProcEvent; [rw]

  

Procedural event handler after archiving

  property BeforeManifest: TNotifyEvent; [rw]

  

Event handler executed before manifest creation

  property BeforeManifestProc: TNotifyProcEvent; [rw]

  

Procedural event handler before manifest creation

  property AfterManifest: TNotifyEvent; [rw]

  

Event handler executed after manifest creation

  property AfterManifestProc: TNotifyProcEvent; [rw]

  

Procedural event handler after manifest creation

  property BeforePkgList: TNotifyEvent; [rw]

  

Event handler executed before package listing

  property BeforePkgListProc: TNotifyProcEvent; [rw]

  

Procedural event handler before package listing

  property AfterPkgList: TNotifyEvent; [rw]

  

Event handler executed after package listing

  property AfterPkgListProc: TNotifyProcEvent; [rw]

  

Procedural event handler after package listing

end;

Inheritance

TPackage

  

Central class for package management and building

|

TNamedItem

  

Base class for items with a name property

|

TCollectionItem

|

TPersistent

|

TObject,IFPObserved

Description

TPackage is the central class in the fpmake build system that represents a complete package. A package contains build targets, dependencies, installation files, and all configuration needed for compilation and deployment.

Each package can contain multiple targets such as units, programs, and libraries. The package manages compilation options, search paths, dependencies on other packages, and installation procedures. It supports cross-platform compilation with CPU and OS-specific settings.

It handles the following aspects:

See also

TTarget

  

Build target representation in the fpmake system

TTargets

  

Collection class for managing build targets

TDependency

  

Represents a build dependency in the fpmake system

TPackageVariants

  

Collection of package variants

TBuildEngine

  

Main build engine for compiling and installing packages

TCustomInstaller

  

Base class for package installers


Documentation generated on: Dec 15 2025