Code::Blocks Forums

User forums => Help => Topic started by: oreja80 on April 18, 2011, 11:34:36 pm

Title: Paths in my CodeBlocks project
Post by: oreja80 on April 18, 2011, 11:34:36 pm
Hey there,

Recently, when I generate my CodeBlocks project with cmake (-G"CodeBlocks - Unix Makefiles"), the project includes the whole tree from root in the directory structure. There have been many changes to the CMakeList, and I was wondering if this issue could be traced to some flag in there that has been added or removed. I would really appreciate any help with this, since with the depth of my home tree the number of clicks to get to the project files is getting a bit out of hand.

Regards,

Dan
Title: Re: Paths in my CodeBlocks project
Post by: oBFusCATed on April 18, 2011, 11:38:58 pm
Paths to the source files are relative to the path of the project.
You can right click in the "project manager -> project tree (this is not mandatory) -> display as on disk" and then use virtual folders
Title: Re: Paths in my CodeBlocks project
Post by: oreja80 on April 18, 2011, 11:54:23 pm
Hi,

Thank you for the quick response.

the project view has selected the option of "display as on disk", but the folder tree starts from /home/... (Linux box) and this didn't use to be the case. It used to start wherever the path project started. I can see that I can add virtual folders, but they wouldn't survive the regeneration of the project, which unfortunately is quite common in my case. That's why I was looking for some insight into the generation of the project with cmake, because I think there might be some effect on the path given. I guess that to make my question more focused I could ask:  If I open the .cbp file in a text editor and scroll down to where all the files of the project are listed, should I see full paths (which is what happens now) or truncated paths to the project path?

Thanks again.
Title: Re: Paths in my CodeBlocks project
Post by: Jenna on April 19, 2011, 12:02:59 am
They should be truncated (relative to the path of the project-file).
If that's not the case, cmake does a bad job, because moving the project to another computer or only to another place on your system might break the project-file.
If you right-click the project in the management-pane and chose "Save project", they should be made relative by C::B (until you regenerate the project with cmake).

I don't know which setting in cmake is responsible for this issue.
You should read the documentation or ask on the cmake website.
Title: Re: Paths in my CodeBlocks project
Post by: oreja80 on April 19, 2011, 12:57:56 am
Yeah, it seems to be a cmake problem. I've gone back to 2.8.2 and it does what you say it should. I've asked on the cmake mailing list to see if there's any info, and I'll post any replies.

Thanks for the help.