Letting CL find XRC and INI files
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Letting CL find XRC and INI files
I'm still using CL 2674 and have tried a search in this forum, but have not found any answer to my 'problem'
I am currently debugging a wxWidgets application using XRC resources - both for ANSI and Unicode versions.
My problem is that it seems I need to have copies of the XRC file in the debug and release directories for CL to be able to find them for debugging or running the apps.
Same issue with using .INI files - this is unlike MS VC, which seems to adjust its search path accordingly.
I've played with the Config entry 'Working Directory" but without much luck.
I am currently debugging a wxWidgets application using XRC resources - both for ANSI and Unicode versions.
My problem is that it seems I need to have copies of the XRC file in the debug and release directories for CL to be able to find them for debugging or running the apps.
Same issue with using .INI files - this is unlike MS VC, which seems to adjust its search path accordingly.
I've played with the Config entry 'Working Directory" but without much luck.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Letting CL find XRC and INI files
The search path is set by your code and by setting the correct working directory.
If your working directory is set to /some/path it means that codelite will do:
cd /some/path
and then it will execute the command you placed in the: project settings -> general -> command
Eran
If your working directory is set to /some/path it means that codelite will do:
cd /some/path
and then it will execute the command you placed in the: project settings -> general -> command
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Re: Letting CL find XRC and INI files
That is what it does, but ....
Since I am building both an ANSI and Unicode release and debug version - and want to keep the executables separate (in separate directories) - otherwise I need to at least re-link every time I want to run or test a version - this means that I have to copy the .INI file, any help files and XRC files to 4 different directories and if I happen to modify one of these I have to ensure all copies are also updated - this is a very big nuisance.
Somehow, the MS IDE VS seems quite happy to use these files in their 'home' location - the root directory of the project or any sub-directories, which I have to take into account in locating the files from within my program - at least that is the way it appears to me. Only when I start using CL do I have to start copying these files to each configuration directory.
I have never seen any place in VS where one would or could specify just what sort of files VS will track down in this way, but as far as I can tell, it works for all of the files I have run into.
Since I am building both an ANSI and Unicode release and debug version - and want to keep the executables separate (in separate directories) - otherwise I need to at least re-link every time I want to run or test a version - this means that I have to copy the .INI file, any help files and XRC files to 4 different directories and if I happen to modify one of these I have to ensure all copies are also updated - this is a very big nuisance.
Somehow, the MS IDE VS seems quite happy to use these files in their 'home' location - the root directory of the project or any sub-directories, which I have to take into account in locating the files from within my program - at least that is the way it appears to me. Only when I start using CL do I have to start copying these files to each configuration directory.
I have never seen any place in VS where one would or could specify just what sort of files VS will track down in this way, but as far as I can tell, it works for all of the files I have run into.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Letting CL find XRC and INI files
CL can do it also:
Lets assume you have debug and release configurations:
codelite *by default* will set the following values in the project settings -> general tab:
This is the file tree:
WorkingDirectory: $(IntermediateDirectory)
Command: ./$(ProjectName)
You could set things like this:
WorkingDirectory: ./Configuration_Files/
Command: ../Debug/MyExe
and for the release configuration:
WorkingDirectory: ./Configuration_Files/
Command: ../Release/MyExe
This will solve your problem.
I am working with VS as well, and there is no magic there, and VS is not smarter... its just that its defaults values are set in a way that the files can be picked in the way you want - settings them like I suggested will do the same for you.
Eran
Lets assume you have debug and release configurations:
codelite *by default* will set the following values in the project settings -> general tab:
This is the file tree:
Code: Select all
root/
Debug/
Release/
Configuration_Files/
Command: ./$(ProjectName)
You could set things like this:
WorkingDirectory: ./Configuration_Files/
Command: ../Debug/MyExe
and for the release configuration:
WorkingDirectory: ./Configuration_Files/
Command: ../Release/MyExe
This will solve your problem.
I am working with VS as well, and there is no magic there, and VS is not smarter... its just that its defaults values are set in a way that the files can be picked in the way you want - settings them like I suggested will do the same for you.
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Re: Letting CL find XRC and INI files
And so it does - and I think I understand a bit more about how these directory specifications are used.
I had played with them some, but never quite got it right.
Thank you ever so much, Eran.
I had played with them some, but never quite got it right.
Thank you ever so much, Eran.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2