Naming executable files

General questions regarding the usage of CodeLite
Tigers!
CodeLite Enthusiast
Posts: 13
Joined: Mon Feb 23, 2009 10:05 am
Location: Australia
Contact:

Naming executable files

Post by Tigers! »

Currently Codelite by default names any executables <ProjectName>.exe.
Is it possible to set it up so that it calls the exe <filename>.exe? That would make it easier for me to keep track of what versions I am currently running.

When I right click on the project name I get the <projectName> Project settings tabs come up.
Under the General tab there is the option of Output File:
I assume that this is where I would put what name I would wish. Currently it is $(IntermediateDirectory)/$(ProjectName). See red in attachment.
I would like it to be $(IntermediateDirectory)/$(<FileName>) where FileName is the current active cpp file. See green in attachment.
Is this possible and how would one describe the Output File string required?
Are any other changes in the other tabs required?
You do not have the required permissions to view the files attached to this post.
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Naming executable files

Post by jfouche »

Hi

I don't know how this can be done as there is multiple files in a project. Which one is the reference one ? You're talking about the selected one, but if I change the selection, and decide to change the include path in my project settings, what happen ?
Honestly , I'm not sure if this can be done ...
To keep track of the version you're using, you can have a look to the VersionManager Plugin (in my signature)
Jérémie
Tigers!
CodeLite Enthusiast
Posts: 13
Joined: Mon Feb 23, 2009 10:05 am
Location: Australia
Contact:

Re: Naming executable files

Post by Tigers! »

There is a cumbersome way to create a <..>.exe file that can follow your <..>.cpp name.
Referring to the attachment - Click on the 'Help' button on the Project Settings will bring up a list of available macroes.
One of those macroes is called ($CurrentFileName). If you replace the ($ProjectName) with ($CurrentFileName) in the Output File: selection then choose 'OK' for once off or 'Apply' for ever after (until you change it again) then when you build the project a file called .exe (no file name, just the extension, .exe) is created.
You can rename that .exe to whatever you want. To keep track of versions I am calling the .exe whatever name the .cpp has.

I have tried it with multiple files in a project and it has allowed me to create multiple .exes. :o

jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Naming executable files

Post by jfouche »

Hi

Looking to CodeLite sources, I can confirm that the macro $(CurrentFileName) is not used during project compilation (but in compile current file). To check, have a look to the folowing function (which does the job):

Code: Select all

 wxString ExpandAllVariables(const wxString &expression, Workspace *workspace, const wxString &projectName, const wxString &selConf, const wxString &fileName)
That seems correct to me not to allow to expand the current file name in project compilation, because what happen in the following cases :
- No file is selected
- when there are project dependancies in a workspace

Maybe you can create multiple configuration, one for each (file) name you need.
I'm not sure to fully understand what you really need, sorry.
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Naming executable files

Post by eranif »

jfouche wrote:Hi

Looking to CodeLite sources, I can confirm that the macro $(CurrentFileName) is not used during project compilation (but in compile current file). To check, have a look to the folowing function (which does the job):

Code: Select all

 wxString ExpandAllVariables(const wxString &expression, Workspace *workspace, const wxString &projectName, const wxString &selConf, const wxString &fileName)
That seems correct to me not to allow to expand the current file name in project compilation, because what happen in the following cases :
- No file is selected
- when there are project dependancies in a workspace

Maybe you can create multiple configuration, one for each (file) name you need.
I'm not sure to fully understand what you really need, sorry.
To add on what jfouche wrote, I too cant really understand what you are trying to achieve here, even if codelite will allow you to use $(CurrentFileName), you will get executables with different names, but all are the same, since executable are compiled from the source files of the project.

If you are trying to achieve different executables based on different files, you MUST create different project for each executable, there is no way to workaround it.

Eran
Make sure you have read the HOW TO POST thread
Tigers!
CodeLite Enthusiast
Posts: 13
Joined: Mon Feb 23, 2009 10:05 am
Location: Australia
Contact:

Re: Naming executable files

Post by Tigers! »

eranif wrote:
To add on what jfouche wrote, I too cant really understand what you are trying to achieve here, even if codelite will allow you to use $(CurrentFileName), you will get executables with different names, but all are the same, since executable are compiled from the source files of the project.

If you are trying to achieve different executables based on different files, you MUST create different project for each executable, there is no way to workaround it.

Eran
Oh. thank you.
Post Reply