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

TTarget

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

Build target representation in the fpmake system

Declaration

Source position: fpmkunit.pp line 726

type TTarget = class(TNamedItem)

public

  constructor Create(); override;

  

Creates a new build target instance

  destructor Destroy; override;

  

Destroys the target instance and frees resources

  procedure AssignTo(); override;

  

Assigns target properties to another object

  function GetOutputFileName(); virtual;

  

Returns the target's output filename for the specified OS

  function HaveOptions;

  

Checks if target has compilation options

  procedure AddOption();

  

Adds a compilation option to the target

  function SubTargetAllowed();

  

Checks if a subtarget is allowed for this target

  function SubTargetsAsString;

  

Returns all subtargets as a comma-separated string

  procedure SetName(); override;

  

Sets the name of the target

  procedure SetExeName();

  

Sets the executable name for the target

  procedure SetXML();

  

Sets XML configuration data for the target

  procedure GetCleanFiles(); deprecated ;

  

Gets list of files to be cleaned for this target

  procedure GetArchiveFiles(); deprecated ;

  

Gets list of files to be archived for this target

  procedure GetInstallFiles(); deprecated ;

  

Gets list of files to be installed for this target

  property Dependencies: TDependencies; [r]

  

Collection of target dependencies

  property ResourceFiles: TResourceFiles; [r]

  

Collection of resource files for the target

  property Commands: TCommands; [r]

  

Collection of custom commands for the target

  property State: TTargetState; [r]

  

Current build state of the target

  property TargetType: TTargetType; [rw]

  

Type of the build target

  property OSes: TOSes; [rw]

  

Set of operating systems this target supports

  property CPUs: TCPUS; [rw]

  

Set of CPU architectures this target supports

  property SubTargets: TRTLStringDynArray; [rw]

  

Array of subtarget names for this target

  property Mode: TCompilerMode; [rw]

  

Compiler mode for the target

  property Options: TStrings; [rw]

  

Compiler options for the target

  property SourceFileName: string; [r]

  

Resolved source file name for the target

  property UnitFileName: string; [r]

  

Resolved unit file name for the target

  property ObjectFileName: string; [r]

  

Resolved object file name for the target

  property LTOFileName: string; [r]

  

Link-time optimization file name for the target

  property RSTFileName: string; [r]

  

Resource string table filename for the target

  property RSJFileName: string; [r]

  

Resource string JSON filename for the target

  property FPCTarget: string; [rw]

  

FPC compiler target specification

  property Extension: string; [rw]

  

File extension for the compiled target

  property FileType: TFileType; [rw]

  

Type of file this target generates

  property Directory: string; [rw]

  

Directory where the target source files are located

  property ResourceStrings: Boolean; [rw]

  

Whether to generate resource string support for the target

  property Install: Boolean; [rw]

  

Whether this target should be installed

  property TargetSourceFileName: string; [r]

  

Source filename for the build target

  property ObjectPath: TConditionalStrings; [r]

  

Path for object files generated during compilation

  property UnitPath: TConditionalStrings; [r]

  

Search path for unit files during compilation

  property IncludePath: TConditionalStrings; [r]

  

Search path for include files during compilation

  property XML: string; [rw]

  

Whether to generate XML documentation for the target

  property IsFPMakePlugin: Boolean; [rw]

  

Whether this target is an FPMake plugin

  property BeforeCompile: TNotifyEvent; [rw]

  

Event handler executed before target compilation

  property AfterCompile: TNotifyEvent; [rw]

  

Event handler executed after target compilation

  property BeforeClean: TNotifyEvent; [rw]

  

Event handler executed before target cleanup

  property AfterClean: TNotifyEvent; [rw]

  

Event handler executed after target cleanup

end;

Inheritance

TTarget

  

Build target representation in the fpmake system

|

TNamedItem

  

Base class for items with a name property

|

TCollectionItem

|

TPersistent

|

TObject,IFPObserved

Description

TTarget represents a single build target within a package, such as a unit, program, or library. Each target defines what needs to be compiled, how it should be compiled, and where the resulting files should be installed.

Build targets can be units, programs, libraries, or documentation files. They contain information about source files, compilation options, dependencies, CPU and OS requirements, and installation settings.

Targets are managed through the TTargets collection and are owned by TPackage instances.

See also

TPackage

  

Central class for package management and building

TTargets

  

Collection class for managing build targets

TTargetType

  

Classification of build target types

TFileType

  

File type classification for build targets

TDependency

  

Represents a build dependency in the fpmake system


Documentation generated on: Dec 15 2025