Lazarus

Using the Lazarus IDE => Options => Topic started by: verstapp on April 12, 2017, 10:35:32 am

Title: save directory
Post by: verstapp on April 12, 2017, 10:35:32 am
i remember in delphi [6, win] there was an option [default?] that all generated files for a project ended up in the directory where the source [.pas, .dfm, .dpr, etc] files lived. this was lovely for me.
lazarus doesn't appear to have this option, or if it does i haven't found it yet. ide options has a 'directory for building test projects' path, but changing it doesn't appear to change anything.
i also found project/options/paths but changing the unit output path didn't change where the executable ended up [in C:\Lazarus].
any ideas?

bote to forum maintainer - when i clicked in the password box when logging on after registering, my up-to-date copy of firefox [52.0.2, 32 bit] complained that this was an insecure site and that my credentials might be stolen. just so's you know..
Title: Re: save directory
Post by: wp on April 12, 2017, 10:49:13 am
If you clear the "Unit output directory" in the project's Compiler Options / Paths the compiler writes everything into the folder of the corresponding source file. I would not recommend this, however, because it makes it unnecessarily hard to remove compiler-generated files from your own code files and you cannot separate platform files.
Title: Re: save directory
Post by: verstapp on April 12, 2017, 11:40:27 am
thanks, wp. i tried it anyway, .exe still ends up in c:\lazarus.
Title: Re: save directory
Post by: wp on April 12, 2017, 12:47:48 pm
The exe is put into the folder specified in "Target file name". Normally this is only the project name, without extension and without prepended path - the latter makes the binary go into the folder of the lpi file.

Is there an path in front of the project name in your case? Or maybe ($LazarusDir)?

Remarks
Title: Re: save directory
Post by: verstapp on April 12, 2017, 01:16:12 pm
Target file name is
project1
lazarus is still putting .exe, .compiled, .ico, .lpi, .lpr, .lps, .o, .obj and .res in c:\lazarus.

but then having closed/restarted lazarus a couple of times, and then created a new project in another folder, all of a sudden everything was saved to the [correct] directory, project2. sometimes 'have you tried turning it off and then on again?' does work. thanks again, wp.
Title: Re: save directory
Post by: wp on April 12, 2017, 02:45:46 pm
Strange. This should not happen... Please come back if, by chance, you might find a way how to reproduce this false behavior.
Title: Re: save directory
Post by: molly on April 12, 2017, 02:51:13 pm
@wp,

afaik (and in case still present then) sometimes project settings changes are not (noted and) saved in project options.

Using resources in project options is also such a option that does not always get noticed by IDE. You can fix that by changing one of the check-boxes in your project options and set it directly back again, then especially do a save project. Note that the asterisk that indicates a change in the project must be present before saving, otherwise the changes will not be saved in project options.
Title: Re: save directory
Post by: tudi_x on June 02, 2017, 02:12:29 pm
hi,
a configuration path where every executable should be created would be nice to have though.

especially now with SSDs the target executable could be rendered on a RamDisk drive instead on wearing the SSD.
TinyPortal © 2005-2018