Author Topic: Add <Unit> to project file using a wizard.script  (Read 3512 times)

Offline roxlu

  • Multiple posting newcomer
  • *
  • Posts: 35
Add <Unit> to project file using a wizard.script
« on: May 16, 2009, 10:53:13 pm »
Hi,

How can I add <Unit filename="..."><Option virtualFolder="folder..." /></Unit> to a project file when using the wizard script?

Roxlu

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Add <Unit> to project file using a wizard.script
« Reply #1 on: May 17, 2009, 12:35:53 am »
Hi roxlu,

have a look at the wiki page (http://wiki.codeblocks.org/index.php?title=Scripting_commands)

Mario

Offline roxlu

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Add <Unit> to project file using a wizard.script
« Reply #2 on: May 17, 2009, 01:25:50 am »
Hi Mariocup,

I have.. I've been searching the sources from the svn, but none of the script create a project file (.cbp) which contains the units and virtual folders need to create.
In my wizard I let the user select what plugins he/she wants to include in his project. Based on the select I need to dynamically add virtual folders and the <Unit filename="file.h"> files (w/o a target subnode).

This is basically what I need to create (though not all filenames should be added.. I want to define which one are added).
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="emptyExample" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Option virtualFolders="addons\;libs\;src\;libs\openframeworks\;libs\openframeworks\app\;libs\openframeworks\communication\;libs\openframeworks\graphics\;libs\openframeworks\sound\;libs\openframeworks\utils\;libs\openframeworks\video\;libs\openframeworks\events\;" />
<Build>
<Target title="release">
<Option output="bin\$(PROJECT_NAME)" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin" />
<Option object_output="obj\release" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
<Target title="debug">
<Option output="bin\$(PROJECT_NAME)_DEBUG" prefix_auto="1" extension_auto="1" />
<Option working_dir="bin" />
<Option object_output="obj\debug\" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Compiler>
<Add option="-Wno-multichar" />
<Add directory="..\..\..\libs\glu" />
<Add directory="..\..\..\libs\freeType\include" />
<Add directory="..\..\..\libs\freeType\include\freetype2" />
<Add directory="..\..\..\libs\freeImage" />
<Add directory="..\..\..\libs\quicktime\CIncludes" />
<Add directory="..\..\..\libs\rtAudio" />
<Add directory="..\..\..\libs\fmodex\inc" />
<Add directory="..\..\..\libs\videoInput\include" />
<Add directory="..\..\..\libs\glee\include" />
<Add directory="..\..\..\libs\glut" />
<Add directory="..\..\..\libs\openFrameworks" />
<Add directory="..\..\..\libs\openFrameworks\app" />
<Add directory="..\..\..\libs\openFrameworks\events" />
<Add directory="..\..\..\libs\openFrameworks\graphics" />
<Add directory="..\..\..\libs\openFrameworks\utils" />
<Add directory="..\..\..\libs\openFrameworks\sound" />
<Add directory="..\..\..\libs\openFrameworks\video" />
<Add directory="..\..\..\libs\openFrameworks\communication" />
<Add directory="..\..\..\libs\poco\includes" />
</Compiler>
<Linker>
<Add option="../../../libs/freeImage/FreeImage.lib" />
<Add option="../../../libs/rtAudio/RtAudio.a" />
<Add option="../../../libs/quicktime/Libraries/qtmlClient.lib" />
<Add option="../../../libs/freeType/lib/libfreetype.a" />
<Add option="../../../libs/glut/libglut.a" />
<Add option="../../../libs/videoInput/lib/videoInputLib.a" />
<Add option="../../../libs/fmodex/lib/libfmodex.a" />
<Add option="../../../libs/glee/lib/GLee.lib" />
<Add option="../../../libs/glu/glu32.lib" />
<Add option="../../../libs/poco/libs/libPocoFoundationmt.a" />
<Add option="../../../libs/poco/libs/libPocoUtilmt.a" />
<Add option="../../../libs/poco/libs/libPocoXMLmt.a" />
<Add option="../../../libs/poco/libs/libPocoNetmt.a" />
<Add option="-lopengl32" />
<Add option="-lglu32" />
<Add option="-ldsound" />
<Add option="-lwinmm" />
<Add option="-ldxguid" />
<Add option="-lstrmbase" />
<Add option="-lstrmiids" />
<Add option="-lz" />
<Add option="-luuid" />
<Add option="-lole32" />
<Add option="-loleaut32" />
<Add option="-lsetupapi" />
<Add option="-lwsock32" />
<Add option="-lws2_32" />
</Linker>
<ExtraCommands>
<Add after='xcopy /e /i /y &quot;$(PROJECT_DIR)..\..\..\other\export\coreDlls_cbWin32\*.dll&quot;  bin' />
<Add after="cmd /c if not exist bin\data mkdir bin\data" />
<Mode after="always" />
</ExtraCommands>
<Unit filename="src\main.cpp">
<Option virtualFolder="src\" />
</Unit>
<Unit filename="src\testApp.cpp">
<Option virtualFolder="src\" />
</Unit>
<Unit filename="src\testApp.h">
<Option virtualFolder="src\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofAppBaseWindow.h">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofAppGlutWindow.cpp">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofAppGlutWindow.h">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofAppRunner.cpp">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofAppRunner.h">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\app\ofBaseApp.h">
<Option virtualFolder="libs\openframeworks\app\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofArduino.cpp">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofArduino.h">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofSerial.cpp">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofSerial.h">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofStandardFirmata.cpp">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\communication\ofStandardFirmata.h">
<Option virtualFolder="libs\openframeworks\communication\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\events\ofEventUtils.h">
<Option virtualFolder="libs\openframeworks\events\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\events\ofEvents.h">
<Option virtualFolder="libs\openframeworks\events\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofBitmapFont.cpp">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofBitmapFont.h">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofGraphics.cpp">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofGraphics.h">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofImage.cpp">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofImage.h">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofTexture.cpp">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofTexture.h">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofTrueTypeFont.cpp">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\graphics\ofTrueTypeFont.h">
<Option virtualFolder="libs\openframeworks\graphics\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\ofMain.h">
<Option virtualFolder="libs\openframeworks\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\sound\ofSoundPlayer.cpp">
<Option virtualFolder="libs\openframeworks\sound\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\sound\ofSoundPlayer.h">
<Option virtualFolder="libs\openframeworks\sound\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\sound\ofSoundStream.cpp">
<Option virtualFolder="libs\openframeworks\sound\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\sound\ofSoundStream.h">
<Option virtualFolder="libs\openframeworks\sound\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofConstants.h">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofMath.cpp">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofMath.h">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofTypes.h">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofUtils.cpp">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\utils\ofUtils.h">
<Option virtualFolder="libs\openframeworks\utils\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofQtUtils.cpp">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofQtUtils.h">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofVideoGrabber.cpp">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofVideoGrabber.h">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofVideoPlayer.cpp">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Unit filename="..\..\..\libs\openFrameworks\video\ofVideoPlayer.h">
<Option virtualFolder="libs\openframeworks\video\" />
</Unit>
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
</Project>
</CodeBlocks_project_file>