LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-19-2009, 06:48 PM   #1
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Rep: Reputation: 34
KDevelop targets, subprojects


Any IDE experts out there? I had a game engine and game editor that I was coding up as two separate projects. Turned out that was the dumb way because I was using about 15 common files between them so when I changed the file in one project I had to remember to change it in the other one.

So I've combined them into the same project but I'm not exactly a KDevelop expert.

I opened the Automake Manager on the right side in the engine project and basically removed everything. Then I made three directories in the src directory. engine, editor, shared. Then I moved the shared files to shared and the engine-only files to engine. Then I grabbed all the editor-only files from the editor project and copied them into editor. Then I made three targets, one for each of them. Then I added all .h and .cpp files for each project to each target. Then I compiled the shared as a library. Then I included the library with the other two projects and compiled them. It works pretty well.

But now when I want to debug I have to have my Data/ folder in the debug directory or the images won't load. Why is the working directory always the debug folder? I can change the working directory if I just execute it but if I want to debug I don't know how to change the working directory. Now suppose I compile it as optimized someday. I will have to have another copy of the Data/ folder in the optimized directory. There has to be another way.

And why did the working directory get moved to the debug folder? Before I combined my engine and editor into one project the working directory for debugging was always debug/src. How did it get moved down a directory? Where do you control that at?

Last edited by icecubeflower; 04-19-2009 at 06:51 PM.
 
Old 04-21-2009, 09:30 AM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
the debug/src folder you had was outogenerated by kdevelop
feel free to change this to your needs, you have already done this

you can set some options like working dir under
Project -> Settings -> Runtime Options
in kdevelop

it is also a good idea to make the path to resource location that you program needs somehow configurable, eg using argv or an enviroment variable

so you do not need to copy your data/resources folder into the debug/optimise dir, just link your resource folder to where you need it does also work
or make your resource location configurable
or specify the working dir under the project settings
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Maven targets Millenniumman Programming 0 07-03-2008 08:14 PM
makefile targets dand Programming 1 07-11-2005 03:28 PM
Adding more targets to Make oulevon Programming 6 02-09-2005 05:11 PM
make with multiple targets eskimo22 Programming 1 02-26-2004 11:42 AM
DoomJuice worm targets M$ LinuxLala General 2 02-10-2004 06:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration