folder structures (0.03 onwards)

Good job guys on getting out 0.03!

I’m going to start converting my project to test.

There are two things I’d like to start doing with my work in the new version and from now on

  1. seperate my work folders from the ofw example apps

  2. keep addons in a better location


Within *\v0.03\app* I will have all the sample projects and my own work. This starts to get messy after a while (especially if I just want to backup my own projects)

What do you think to putting everything into an additional folder, such as
*\v0.03\app\examples\
\v0.03\app\work*

And then changing the relative path of links to go up an extra folder? …\

What does everyone think?


At the moment my addons go within *\v0.02\libs\openFrameworks* but it feels like this folder should be kept only for the ofw core release, making it easier to port projects to newer versions in the future and easier to upgrade addons.

For example, I have the opencv addons source files in
*\v0.02\libs\openFrameworks\computerVision*

and I have ofXML in
*\v0.02\libs\openFrameworks\utils*

How about we make the instruction for installing into these folders?

*\v0.03\libs\ofwAddons\
\v0.03\libs\ofwAddons\opencv\
\v0.03\libs\ofwAddons\ofXML*

So when we upgrade to 0.04, the core code in *\libs\openFrameworks* will be completely seperated from the addons in *\libs\ofwAddons*

Thoughts??

hi chris,

thanks! those are both solid ideas.

about the first, I agree – the number of folder can become unwieldy, but at the same time the deeper the structure, that harder it is to get it right. I wonder what other people think ?

one thing I’ve been thinking would be useful is a tool that could generate the .vcproj, .dev, .cbp, makefile for you (since for the most part if one is made, the difference is some minor find and replace, and to do nested folders, just getting the amount of …/…/s right. In this latest release we’ve started to use python scripts to automate the process (mirroring code, updating project files, etc) so it wouldn’t be so hard to make a small app that could help generate new OF projects.

about the addons, this is also a good sugestion. we are just about to make a major posting of addons, instructions and so on, so I am going to play around w/ it. I was actually thinking this morning, better might be:

apps/
libs/
addons/

then in addons, you could have:
addons/ofCv
addons/ofXML

or even more organized

addons/utils/ofXML

then, you would still have to get these new paths into the project (The way you normally do) but it would make it alot cleaner, so that the core libs of OF never change. what do you think?

(getting those paths in could be another part of the tool I mention above, point it to an “addon” and then to the “project” you want to make sure the addon is included in… I’m not sure how feasible it is, but if someone want to hack around in python, I’d be happy to kick around some ideas. we definitely want to make it easy to make new projects and to install / use addons)

thanks!
zach

I am trying to do step 1. I have added an extra …\ to all property paths in c++ and linker for debug and release, but when I go to build the empty app I get this error

1>------ Build started: Project: openFrameworksApp, Configuration: Debug Win32 ------
1>Linking…
1>LINK : fatal error LNK1104: cannot open file ‘.\obj\debug\ofAppRunner.obj’
1>Build log was saved at “file://c:\OpenFrameWorks\v0.03\app\work\emptyExample\obj\Debug\BuildLog.htm”
1>openFrameworksApp - 1 error(s), 0 warning(s)

Any ideas?

about the addons, this is also a good sugestion. we are just about to make a major posting of addons, instructions and so on

Oh really? Which addons will you be posting?

I think your idea is better, so I have started organising mine like this:
apps/
libs/
addons/

I don’t think further folders (utils, comms etc) are needed. Just put the addons in the addons folder (a bit like the processing library folder)

hi,

I think you may have added …/ to too many things - can you post the .vcproj file? I can compare it to the basic one and see what looks wrong.

thanks
zach

Sure, here you go

http://www.chrisoshea.org/storage/openF-…-App.vcproj

When I go to build it gives me this error log

1>------ Build started: Project: openFrameworksApp, Configuration: Release Win32 ------
1>Compiling…
1>ofSerial.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\communication\ofSerial.cpp’: No such file or directory
1>ofVideoPlayer.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\video\ofVideoPlayer.cpp’: No such file or directory
1>ofVideoGrabber.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\video\ofVideoGrabber.cpp’: No such file or directory
1>ofQtUtils.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\video\ofQtUtils.cpp’: No such file or directory
1>ofUtils.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\utils\ofUtils.cpp’: No such file or directory
1>ofMath.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\utils\ofMath.cpp’: No such file or directory
1>ofSoundStream.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\sound\ofSoundStream.cpp’: No such file or directory
1>ofSoundPlayer.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\sound\ofSoundPlayer.cpp’: No such file or directory
1>ofTrueTypeFont.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\graphics\ofTrueTypeFont.cpp’: No such file or directory
1>ofTexture.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\graphics\ofTexture.cpp’: No such file or directory
1>ofImage.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\graphics\ofImage.cpp’: No such file or directory
1>ofGraphics.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\graphics\ofGraphics.cpp’: No such file or directory
1>ofAppRunner.cpp
1>c1xx : fatal error C1083: Cannot open source file: ‘…\libs\openframeworks\app\ofAppRunner.cpp’: No such file or directory
1>Build log was saved at “file://c:\OpenFrameWorks\v0.03\app\work\emptyExample\obj\Release\BuildLog.htm”
1>openFrameworksApp - 13 error(s), 0 warning(s)

Thanks

hi chris,

I think you just need to change also the relative paths to the OF files themselves, since OF needs to be compiled for the project.

towards the bottoms, where it says in the xml “”

change all of them (except for main, testApp.h, and testApp.cpp which have stayed the same relative position to the .vcproj file), like this:

  
  
RelativePath="..\..\libs\openFrameworks\ofAddons.h"  
  

to

  
  
RelativePath="..\..\..\libs\openFrameworks\ofAddons.h"  
  

I haven’t tested, but I think that should do the trick -

thanks!
zach

Ah, you are right of course. I fixed those, now i get this error

1>ofGraphics.cpp
1>ofAppRunner.cpp
1>Linking…
1>Generating code
1>Finished generating code
1>Embedding manifest…
1>adding DLLs and creating data folder
1>File not found - *.dll
1>0 File(s) copied
1>Project : error PRJ0019: A tool returned an error code from “adding DLLs and creating data folder”
1>Build log was saved at “file://c:\OpenFrameWorks\v0.03\app\work\emptyExample\obj\Release\BuildLog.htm”
1>openFrameworksApp - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

ah ok now you will need to change the relative path in this tag:

  
  
<Tool  
Name="VCPostBuildEventTool"  
Description="adding DLLs and creating data folder"  
CommandLine="xcopy /e /i /y &quot;$(ProjectDir)\..\..\other\dlls\*.dll&quot; $(ConfigurationName)&#x0D;&#x0A;if not exist &quot;$(ConfigurationName)\data&quot; mkdir  &quot;$(ConfigurationName)\data&quot;&#x0D;&#x0A;"  
/>  
  

it’s in the vcproj twice, once for debug, once for release. this routine is copying the dlls and making the data folder once the app is compiled.

almost there!

take care, zach

Hurrah, this now works.

There seems to be a memory leak in emptyExample. It starts using 10,132k of ram and climbs up. Actually as I type this, it holds at 11,068k so it seems to be fine.

Thanks for your help,

great

I’ve noticed the same behavior with empty opengl projects, and nearly spent half an afternoon pulling my hair out. I think it’s nothing, just take a while for the memory usage to move up to normal so it appears to be leaking. it may have to do with glut or gl, or somthing else. anyway, don’t worry - the empty project is definitely stable :slight_smile:

have fun!
zach

I use this arrangement for my apps as I also prefer not to nest files deeper than necessary:

/app
/libs
/myapps
/myotherapps

Just a thought,

… or better

/app
/app-projectX
/app-awesomest
/app-fantasmagorgous
/libs

:wink:

Hi,

Realized the change with the data folder. I’m normally using the same data folder for both debug and release, since i dont need to change settings in xml-files twice. so i keep my data in v0.04/app/data. By adding these two lines to the vcproj file i can keep doing that since the data in that folder is copied at compile time to the corresponding release/data or debug/data folder

  
  
<Tool  
Name="VCPostBuildEventTool"  
Description="adding DLLs and creating data folder"  
CommandLine="xcopy /e /i /y &quot;$(ProjectDir)\..\..\other\dlls\*.dll&quot; $(ConfigurationName)&#x0D;&#x0A;if not exist &quot;$(ConfigurationName)\data&quot; mkdir  &quot;$(ConfigurationName)\data&quot;&#x0D;&#x0A;if not exist &quot;$(ProjectDir)\data&quot; mkdir  &quot;$(ProjectDir)\data&quot;&#x0D;&#x0A;xcopy /e /i /y &quot;$(ProjectDir)\data\*.*&quot; $(ConfigurationName)\data&#x0D;&#x0A;"  
/>  
  

If i leave the app/data folder empty nothing changes, but if i have something in there it is copied. Do you see any drawbacks to this? I guess it can still be used the way it is now, but you can also share files between debug and release.

To clearify, the folder structure is this:

  
  
app/data            - (common files)  
app/release/data    - (release files)  
app/debug/data      - (debug files)  
app/src  
  

this is hardcore
/cj