Recent

Author Topic: unit output directory outside of project directory  (Read 810 times)

Чебурашка

  • Hero Member
  • *****
  • Posts: 577
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
unit output directory outside of project directory
« on: May 24, 2023, 10:24:28 am »
Hello,
let us assume to create a brand new lazarus project "project1" on "/home/user/project1-source-folder".

As default on my lazarus version (below), the unit output directory is "lib/$(TargetCPU)-$(TargetOS)" and the target file name is "project1". Both inside "/home/user/project1-source-folder".

For reasons related to the later usage of rsync, I'd find more comfortable that the compiler's output is placed on a dedicated folder, say "/home/user/project1-build-folder".

To achieve this I simply set unit output directory to "../project1-build-folder/lib/$(TargetCPU)-$(TargetOS)" and target file name to "../project1-build-folder/project1" (relative paths here, but I could also write absolute ones equivalently).

It works perfectly as output of compiler is where I want.

The only difference is that when I work with the latter configuration, when lazarus has to create the destination folders for the first time, it does ask for confirmation, while it doesn't do the same in "standard" configuration.

Is it correct? Is it possible to disable the confirmation somehow?
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 577
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: unit output directory outside of project directory
« Reply #1 on: May 25, 2023, 01:32:49 pm »
No idea?
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: unit output directory outside of project directory
« Reply #2 on: May 25, 2023, 01:43:28 pm »
This is one of the things (relative paths) Lazarus does better than Delphi.

Are the default dirs simply always made by the project, even if you specify others?

Чебурашка

  • Hero Member
  • *****
  • Posts: 577
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: unit output directory outside of project directory
« Reply #3 on: May 25, 2023, 02:21:45 pm »
Are the default dirs simply always made by the project, even if you specify others?

No, sorry, I did not explain myself clearly.

I attached a tgz. In the folder there are 2 projects, one standard with output inside project folder, the other outside. At first compile one does not ask anything, while the other asks confirmation.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

 

TinyPortal © 2005-2018