Recent

Author Topic: [solved] specify output folder for executable and object files separately?  (Read 4521 times)

FangQ

  • Full Member
  • ***
  • Posts: 135
hi

I am wondering if this is possible with lazarus: I want to save all the temporarily files, such as the object files, into a folder, say "$App/debug", and the generated executable into the main application source folder ($App).

For the first part, I can do it using the compiler options dialog in the project menu. But the binary will be generated in this folder too. This caused troubles for me. When my program starts, I used ExtractFilePath(Application.ExeName) to get the current folder to access some assumed sub-folder structures, such as $App/data, $App/utils etc. However, all of these subfolders were put under the main source code directory, not the debug sub folder.

Alternatively, would it be possible to specify the Application.ExeName so that it remains to be $App, despite that the binary is from $App/debug?

thanks
« Last Edit: August 18, 2009, 05:09:27 pm by FangQ »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12296
  • Debugger - SynEdit - and more
    • wiki
Re: specify output folder for executable and object files separately?
« Reply #1 on: August 18, 2009, 12:47:51 am »
in the project options, on the first tab "Application", towards the bottom is a box:

"target file name"

in there you can put the path AND filename of your desired exe
 the path can be relative, and I believe it is relative to the source dir.... (but you have to check that last bit

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: specify output folder for executable and object files separately?
« Reply #2 on: August 18, 2009, 03:36:50 pm »
It is relative to the project file (.lpi).

FangQ

  • Full Member
  • ***
  • Posts: 135
Re: specify output folder for executable and object files separately?
« Reply #3 on: August 18, 2009, 05:09:14 pm »
in the project options, on the first tab "Application", towards the bottom is a box:

"target file name"

in there you can put the path AND filename of your desired exe
 the path can be relative, and I believe it is relative to the source dir.... (but you have to check that last bit

Excellent! I gave only the binary file name in that field, and now the binary is generated in the same folder as the lpi file. This is exactly what I want.

thank you and Vincent for your help.

 

TinyPortal © 2005-2018