Recent

Author Topic: How to give a custom extension to compiled project  (Read 5016 times)

wOvAN

  • New Member
  • *
  • Posts: 47
    • wxSoft.Ru
How to give a custom extension to compiled project
« on: July 21, 2011, 04:48:11 pm »
In Delphi there is a compiler directive {$E ext_name} that allows to give a compiled binary file a custom extension.

Ex:
Code: [Select]
library MyLib;
{$E myext}
begin
end.

gives library with name "MyLib.myext"

Sadly it doesn't work in Lazarus.

Is there a way to do this?


BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to give a custom extension to compiled project
« Reply #1 on: July 21, 2011, 04:55:04 pm »
If you want to, you can enter a feature request in the bug tracker.

Also, in Lazarus, in the project options post compile settings, you can call a script that renames the extension.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: How to give a custom extension to compiled project
« Reply #2 on: July 21, 2011, 05:18:56 pm »
Can't you set the target file name in the project options?

Gr.
Dirk.

wOvAN

  • New Member
  • *
  • Posts: 47
    • wxSoft.Ru
Re: How to give a custom extension to compiled project
« Reply #3 on: July 21, 2011, 05:23:23 pm »
Can't you set the target file name in the project options?

Gr.
Dirk.

No, i want to implement component for creation control panel applets for windows with extension ".cpl" it should be automatic.

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: How to give a custom extension to compiled project
« Reply #4 on: July 21, 2011, 05:50:56 pm »
Using something like '$NameOnly($(ProjFile)).cpl' as the target file name would be automatic enough for me...

Gr.
Dirk.'

Edit: I see you already submitted a change request in the bugtracker yesterday... Since it's an FPC request I assume you don't use Lazarus, something that is not really clear in your post here.
« Last Edit: July 21, 2011, 05:57:08 pm by DirkS »

wOvAN

  • New Member
  • *
  • Posts: 47
    • wxSoft.Ru
Re: How to give a custom extension to compiled project
« Reply #5 on: July 21, 2011, 06:04:32 pm »
Using something like '$NameOnly($(ProjFile)).cpl' as the target file name would be automatic enough for me...

Gr.
Dirk.'

Edit: I see you already submitted a change request in the bugtracker yesterday... Since it's an FPC request I assume you don't use Lazarus, something that is not really clear in your post here.

Thanks, though I don't see a way to put setting into project's template.

I'm not sure where to post this request,I found compiler section only in FPC's bugtracker. Should I post to lazarus's ?

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: How to give a custom extension to compiled project
« Reply #6 on: July 21, 2011, 06:22:51 pm »
Quote
I'm not sure where to post this request,I found compiler section only in FPC's bugtracker. Should I post to lazarus's ?
If you would like to use it outside Lazarus (e.g. by using make or the fpc compiler directly) then I think your request is in the right place.

Quote
though I don't see a way to put setting into project's template.
See Project Options / Compiler Options / Paths / Target Filename.
Not sure if there were any changes here in recent Lazarus versions.
See also http://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Target_file_name_2

Gr.
Dirk.

 

TinyPortal © 2005-2018