Code::Blocks project importer / CodeLite .project format

Discussion about CodeLite development process and patches
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Code::Blocks project importer / CodeLite .project format

Post by TurboLento »

Ok, thanks for all the help! I understand now what those tags are for. CodeBlocks doesn't have a few of the concepts you incorporated, so in the conversion I think I'll leave these hardcoded to an arbitrary value.

I think I mislead you in my initial posts with the different project names. From testing in my computer I believe the problem is still related to filenames. By adding the same project file, with just a different filename, the error appears (when the filename doesn't match the project name). (Note that I'm not trying to add both projects with the same name to the workspace, one after the other; each time, I went and cleaned the .workspace from all references to the project before adding the other one).

Hopefully the files I post in the attachment will help clarify.
I've attached workspaces and projects that I think illustrate the problem. Within you'll find the following:

CodeLiteWorkspace_INITIAL.workspace: workspace before adding any project
CodeLiteWorkspace_AFTER_ADDING_JUST_UTILS_PROJECT.workspace: the initial workspace after adding the project which loads correctly (this is already the converted project).
CodeLiteWorkspace_AFTER_ADDING_JUST_UTILS_CONVERSION_PROJECT.workspace: the same but after adding the (problematic) project, which throws the "AddToBuildMatrix" error.
Utils.project: project file that loads succesfully.
Utils_Conversion.project: project file that throws the error when added to the workspace. Same file as Utils.project, but renamed.

Again, thanks for the help, and for the tips on the plugins (which I would eventually come up against :)
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Code::Blocks project importer / CodeLite .project format

Post by eranif »

You are correct!

I found a bug in the method: Workspace::AddProject(...), it used the filename (without the extension nor the path) as the file name...

(you will have to excuse me I wrote that function couple of years ago :D )
This is now fixed in trunk.

Eran
Make sure you have read the HOW TO POST thread
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Code::Blocks project importer / CodeLite .project format

Post by TurboLento »

Excellent, glad I could help :)
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Code::Blocks project importer / CodeLite .project format

Post by TurboLento »

Hi Eran, I ran into some problems, and would like to ask you for advice, or even if it's a possible bug I found.

Attempting the conversion for the "Simple Fast Media Library" (http://www.sfml-dev.org/) CodeBlocks projects, which uses directories with spaces (specifically, in the "IntermediateDirectory").

I'm saving these directories in the .project file by placing quote marks around the path with spaces (resulting in something like IntermediateDirectory='"../../Temp/sfml-window/Debug DLL_Win32"').

(This makes compilation work, at the step of linking with object files, which, without the quote marks, fails:
g++ -c "H:/Paulo-Programma/Programma/libs/SFML/src/SFML/System/Lock.cpp" -Wall -g -O0 -DWIN32 -D_DEBUG -D_LIB -DSFML_EXPORTS -DSFML_DYNAMIC -o ../../Temp/sfml-system/Debug DLL_Win32/System_Lock.o "-I../../src" "-I../../include"
g++: DLL_Win32/System_Clock.o: No such file or directory
But with quote marks does alright.)


A problem arises when compiling, which, I think, comes from the makefile generation (and invocation).
In the .mk file for the project, the "IntermediateDirectory" field shows as:
IntermediateDirectory:="../../Temp/sfml-window/Debug DLL_Win32"
makeDirStep shows up with two pairs of quote marks, like such:
makeDirStep:
@$(MakeDirCommand) ""../../Temp/sfml-window/Debug DLL_Win32""
And I think it is here that it is failing, because the "makedir" command is not creating the correct output directory.
(I also get a few compiler warnings like "sfml-window.mk: warning: overriding commands for target `"../../Temp/sfml-window/Debug' and "ignoring old commands for target `".././Temp/sfml-window/Debug'", not sure if they are related, but the target name in the makefile is the same as the directory name)

Otherwise If I replace the space with an underscore in the directory name, no problem occurs.

Is there a way for me to correct this on my converter, is it a bug, or is converting a project with spaces in directories out of question (please, not the last one! :) )
fanhe0513
CodeLite Enthusiast
Posts: 39
Joined: Sat Aug 21, 2010 7:32 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Code::Blocks project importer / CodeLite .project format

Post by fanhe0513 »

I need specification to.
If there is not, can you give me a full .workspace sample an a full .project sample.
Thanks.

I am working for a project which "embed" codelite into gvim
screenshot1.png
You do not have the required permissions to view the files attached to this post.
Post Reply