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?
Naming executable files
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Mon Feb 23, 2009 10:05 am
- Location: Australia
- Contact:
Naming executable files
You do not have the required permissions to view the files attached to this post.
-
- 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
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)
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
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Mon Feb 23, 2009 10:05 am
- Location: Australia
- Contact:
Re: Naming executable files
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.
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.
-
- 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
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):
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.
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)
- 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
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Naming executable files
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.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):That seems correct to me not to allow to expand the current file name in project compilation, because what happen in the following cases :Code: Select all
wxString ExpandAllVariables(const wxString &expression, Workspace *workspace, const wxString &projectName, const wxString &selConf, const wxString &fileName)
- 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.
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
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Mon Feb 23, 2009 10:05 am
- Location: Australia
- Contact:
Re: Naming executable files
Oh. thank you.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