Difference between revisions of "IDE Window: Package Options"

From Free Pascal wiki
Jump to navigationJump to search
m
(19 intermediate revisions by 4 users not shown)
Line 2: Line 2:
  
 
== Usage ==
 
== Usage ==
 +
 +
This options page is accessible by opening the [[Lazarus_Packages#The_IDE_menu_items_for_packages|package editor]] and then clicking on ''Options'' and selecting ''Package Options''.
  
 
=== Add Paths to dependent packages / project ===
 
=== Add Paths to dependent packages / project ===
Line 10: Line 12:
  
 
You can see, what paths are inherited from other packages/projects in the [[IDE Window: Compiler Options|compiler options]] dialog.
 
You can see, what paths are inherited from other packages/projects in the [[IDE Window: Compiler Options|compiler options]] dialog.
 +
 +
'''Note:''' The IDE normalizes search paths. For example it trims spaces trailing spaces and chomps the trailing path delimiter (windows: \, all other: /). It chomps them because FPC treats '\' plus space as a special character.
  
 
==== Unit ====
 
==== Unit ====
  
These paths are separated by semicolon, can contain macros, and are appended to the ''unit'' paths of all packages/projects, which use/require this package. The ''unit'' path is used by the IDE and the compiler to search for pascal units (.pas, .pp, .ppu).
+
These paths are separated by semicolon, can contain [[IDE Macros in paths and filenames|macros]], and are appended to the ''unit'' paths (compiler option '''-Fu''') of all packages/projects, which use/require this package, but not the package itself. The ''unit'' path is used by the IDE and the compiler to search for pascal units (.pas, .pp, .ppu). The default is ''$(PkgOutDir)/'' which is a macro for the [[IDE_Window:_Compiler_Options#Other_Unit_Files|package output directory]]
 +
 
 +
Notes:
 +
*Leave this to $(PkgOutDir) unless you want to override units of other packages.
 +
*Use the compiler options unit paths to extend the search path of the package.
  
 
==== Include ====
 
==== Include ====
  
Same as the ''unit'' path, but for the ''include'' path - include files.
+
Same as the ''unit'' path, but for the ''include'' path - include files (compiler option '''-Fi''').
 +
 
 +
Notes:
 +
*Leave this empty, unless you want to provide a global include file
 +
*If you want extend the include path of the package change the include path in the compiler options instead.
  
 
==== Object ====
 
==== Object ====
  
Same as the ''unit'' path, but for the ''object'' path (.o files).
+
Same as the ''unit'' path, but for the ''object'' path (.o files, compiler option '''-Fo''').
  
 
==== Library ====
 
==== Library ====
  
Same as the ''unit'' path, but for the ''library'' path (linker files).
+
Same as the ''unit'' path, but for the ''library'' path (linker files, compiler option '''-Fl''').
  
 
=== Add options to dependent packages and projects ===
 
=== Add options to dependent packages and projects ===
Line 31: Line 43:
 
==== Linker ====
 
==== Linker ====
  
These options are separated by space, can contain macros and are appended to the ''linker'' options of all packages/projects, which use/require this package. Line breaks are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.
+
These options are separated by space, can contain macros and are appended to the ''linker'' options (compiler option '''-k''') of all packages/projects, which use/require this package. Line breaks are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.
  
 
==== Custom ====
 
==== Custom ====
  
These options are separated by space, can contain macros and are appended to the ''custom'' options of all packages/projects, which use/require this package. Line breaks are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.
+
These options are separated by space, can contain macros and are appended to the ''custom'' options of all packages/projects, which use/require this package. Line breaks and special characters #0..#31 are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.
 +
 
 +
=== Project ===
 +
 
 +
==== Add package unit to uses section ====
 +
 
 +
If checked the package main unit is added to the projects uses section. This means all package units are compiled into to the project, ensuring that all initialization sections of all package units are executed. If the package contains units that should not be added always, uncheck this.
  
 
== Description ==
 
== Description ==
Line 60: Line 78:
 
* '''Build number''' - increase this everytime you rebuild this package. Will eventually be incremented automatically by below option.
 
* '''Build number''' - increase this everytime you rebuild this package. Will eventually be incremented automatically by below option.
  
==== Automatically increment version on build ====
 
  
Not implemented yet. Main problem is: It must be incremented before building, because of macros. And it should not be increased if build fails.
 
  
 
== IDE Integration ==
 
== IDE Integration ==
Line 68: Line 84:
 
=== Package Type ===
 
=== Package Type ===
  
* '''Designtime only''' - The package is used only at designtime, in other words: it is only a plugin for the IDE and is never used by normal applications. A designtime package requires the IDEIntf package, which contains the interface functions to the IDE. If you use a designtime package in a project, the IDE will warn you.
+
See [[Lazarus_Packages#Design_Time_vs_Run_Time_package|here]].
* '''Runtime only''' - The package does not provide any IDE goodies, so the package should not be installed in the IDE. For example, because it uses a special memory manager or library.
 
* '''Designtime and Runtime''' - The package provides some IDE stuff and some stuff useful for normal applications.
 
  
 
=== Update/Rebuild ===
 
=== Update/Rebuild ===
Line 77: Line 91:
 
* '''Auto rebuild when rebuilding all''' - As above, but only if the user explicitly chose to rebuild all.
 
* '''Auto rebuild when rebuilding all''' - As above, but only if the user explicitly chose to rebuild all.
 
* '''Manual compilation (never automatically)''' - The package is never rebuilt indirectly. You must open the [[IDE Window: Package Editor|package editor]] and click compile to compile this package. Note: Some built in packages like the FCL and the LCL can only be copiled by special ways, like make.
 
* '''Manual compilation (never automatically)''' - The package is never rebuilt indirectly. You must open the [[IDE Window: Package Editor|package editor]] and click compile to compile this package. Note: Some built in packages like the FCL and the LCL can only be copiled by special ways, like make.
 +
 +
=== FPDoc files path ===
 +
 +
Contains paths to FPDoc files with documentation for the package.
 +
 +
== i18n ==
 +
 +
'''i18n''' is an abbreviation of internationalization and means in Lazarus the translation of string constants to various languages (e.g. Spanish or German). The compiler creates .rst files from resourcestrings. Enable the i18n option and give a sub directory (usually 'locale', 'languages', 'po' or 'i18n') and the IDE will convert all .rst files into .po files. You can then translate the .po files into one extra .po file for each language. The IDE will update the translations as well. For example when a new resourcestring is added in the source and you compile the IDE will add the string to the base .po file and each translated .po file. The IDE automatically loads these .po files for designtime packages. For your own programs see [[Getting_translation_strings_right|here]].
 +
 +
*'''Create/Update po file when saving lfm file''': The IDE can collect all TTranslateString properties of a form and store the strings in the .po too (Since 0.9.31). You can disable this feature for single forms in the package editor.

Revision as of 15:43, 3 July 2015

Deutsch (de) English (en) français (fr) русский (ru)

Usage

This options page is accessible by opening the package editor and then clicking on Options and selecting Package Options.

Add Paths to dependent packages / project

All these paths are not used by this package itself, but they are added to the appropriate paths of the packages/projects, that use this package. These are called inherited paths. For example: Package A needs Package B needs Package C. All usage options of C are appended to the options of B and A.

For example almost all packages inherit their output directory, so that any package, that uses this package, finds the .ppu files.

You can see, what paths are inherited from other packages/projects in the compiler options dialog.

Note: The IDE normalizes search paths. For example it trims spaces trailing spaces and chomps the trailing path delimiter (windows: \, all other: /). It chomps them because FPC treats '\' plus space as a special character.

Unit

These paths are separated by semicolon, can contain macros, and are appended to the unit paths (compiler option -Fu) of all packages/projects, which use/require this package, but not the package itself. The unit path is used by the IDE and the compiler to search for pascal units (.pas, .pp, .ppu). The default is $(PkgOutDir)/ which is a macro for the package output directory

Notes:

  • Leave this to $(PkgOutDir) unless you want to override units of other packages.
  • Use the compiler options unit paths to extend the search path of the package.

Include

Same as the unit path, but for the include path - include files (compiler option -Fi).

Notes:

  • Leave this empty, unless you want to provide a global include file
  • If you want extend the include path of the package change the include path in the compiler options instead.

Object

Same as the unit path, but for the object path (.o files, compiler option -Fo).

Library

Same as the unit path, but for the library path (linker files, compiler option -Fl).

Add options to dependent packages and projects

Linker

These options are separated by space, can contain macros and are appended to the linker options (compiler option -k) of all packages/projects, which use/require this package. Line breaks are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.

Custom

These options are separated by space, can contain macros and are appended to the custom options of all packages/projects, which use/require this package. Line breaks and special characters #0..#31 are converted to spaces. Several spaces are treated as one, except if they are enclosed by quotes.

Project

Add package unit to uses section

If checked the package main unit is added to the projects uses section. This means all package units are compiled into to the project, ensuring that all initialization sections of all package units are executed. If the package contains units that should not be added always, uncheck this.

Description

Description / Abstract

Write here in a few words, what this package does.

Author

You.

License

If you publish/distribute/sell your package, it is a good idea to add the license information.

Version

Here is a suggestion, how to use the version numbers:

  • Major - increase this, if your package changed a lot.
  • Minor - increase this, if your package changes it API slightly. For example new features or a method changed its parameters.
  • Revision - increase this every time you distribute your package.
  • Build number - increase this everytime you rebuild this package. Will eventually be incremented automatically by below option.


IDE Integration

Package Type

See here.

Update/Rebuild

  • Automatically rebuild as needed - Everytime a project or package that uses this package (direct or indirect) is rebuilt, the IDE checks, if any file of this package has changed and recompiles this package.
  • Auto rebuild when rebuilding all - As above, but only if the user explicitly chose to rebuild all.
  • Manual compilation (never automatically) - The package is never rebuilt indirectly. You must open the package editor and click compile to compile this package. Note: Some built in packages like the FCL and the LCL can only be copiled by special ways, like make.

FPDoc files path

Contains paths to FPDoc files with documentation for the package.

i18n

i18n is an abbreviation of internationalization and means in Lazarus the translation of string constants to various languages (e.g. Spanish or German). The compiler creates .rst files from resourcestrings. Enable the i18n option and give a sub directory (usually 'locale', 'languages', 'po' or 'i18n') and the IDE will convert all .rst files into .po files. You can then translate the .po files into one extra .po file for each language. The IDE will update the translations as well. For example when a new resourcestring is added in the source and you compile the IDE will add the string to the base .po file and each translated .po file. The IDE automatically loads these .po files for designtime packages. For your own programs see here.

  • Create/Update po file when saving lfm file: The IDE can collect all TTranslateString properties of a form and store the strings in the .po too (Since 0.9.31). You can disable this feature for single forms in the package editor.