Author Topic: Paths in my CodeBlocks project  (Read 8465 times)

Offline oreja80

  • Single posting newcomer
  • *
  • Posts: 3
Paths in my CodeBlocks project
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Paths in my CodeBlocks project
« Reply #1 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oreja80

  • Single posting newcomer
  • *
  • Posts: 3
Re: Paths in my CodeBlocks project
« Reply #2 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Paths in my CodeBlocks project
« Reply #3 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.

Offline oreja80

  • Single posting newcomer
  • *
  • Posts: 3
Re: Paths in my CodeBlocks project
« Reply #4 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.