[Lazarus] Create a package - how?
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Jun 4 09:26:54 CEST 2009
On Thu, 04 Jun 2009 07:56:52 +0200
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> I want to create a package from my
> lazarus/examples/dockmanager/easytree/ project, containing the
> EasyDockSite docking manager. Creating the package is no problem, it
> compiles without problems, and as a runtime-only package with no
> visual components it needs no installation. But I could not yet use
> it in another project. The splitted EasyDocking project reports
> problems with multiple ppu/o files, other projects cannot find the
> unit files.
>
> After some tries and assistance from the chat I've moved the package
> source files into a new directory dockmanager/package. Is that okay?
Yes, if this is an example package only used by the examples.
> Next question: where to place the package project, into the
> dockmanager/ or dockmanager/package directory?
I don't know what you mean with "package project". An example project
for the package? Or the package main file (.lpk)?
Don't mix source directories. Every source directory should be
exactly in one project or in one package.
> With the project in dockmanager/, adding files resulted in a dialog
> "New unit not in unitpath", suggesting "Add package/ to UnitPath". Of
> course the path should be added?
Not always.
> ********************************************************************
> BTW: this dialog appears on the wrong monitor, not the one with the
> Package dialog :-(
> The same for "File not found" while loading a project.
please create a bug report.
> The "Add to project" dialog has an CANCEL button with
> Caption="CancelDependButton".
please create a bug report.
> ********************************************************************
>
> The remaining problems seem to be related to the package pathes. The
> "Package Options" dialog shows Unit = "$(PkgOutDir)". What's
> "PkgOutDir",
see
http://wiki.lazarus.freepascal.org/IDE_Window:_Package_Options#Unit
> and what's "PkgDir" found somewhere else?
where is "somewhere else"?
here is the list of macros:
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames
> It looks as if
> the Compiler Options -> Paths defines PkgOutDir as -FU, relative to
> the package project file?
bingo. Except that there is no "package project file".
see
http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Paths
> After some opening and closing of dialogs, the Unit entry has changed
> to "$(PkgOutDir)/", the added trailing "/" seems to be more
> consistent with other package settings?
yes, see
http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Paths
> Should I check "Add package unit to uses section" - what's the
> purpose or benefit of this option?
I added some info to the wiki. Press F1.
> After I created the package during above steps, and updated the
> original sample project to use the new package, everything worked
> fine on Linux. Not so on Windows :-(
You forgot to tell the error message.
Mattias
More information about the Lazarus
mailing list