User forums > Using Code::Blocks
Is there a script to generate automatically all the *.cbp project files?
Pierre8r:
Hello BlueHazzard,
It's about C++ files not C files.
I want to create a cbp file for each directory and sub directory.
choisir_les_constructeurs.cbp
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="choisir_les_constructeurs" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/choisir_les_constructeurs" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/choisir_les_constructeurs" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---
finale.cbp
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="finale" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/finale" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/finale" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>
--- End code ---
ollydbg:
Here is my suggestion:
1, you can write a simple script(maybe using python) file which replace the source file paths in the cbp(you may first create a cbp template).
2, you can write a simple cmake, and let cmake generate all the cbp files.
I think method 1 is easier.
BlueHazzard:
I have looked into the squirrel api and it is not possible with the current api in codeblocks to do this within codeblocks...
The API is missing some folder traversing and file searching... : http://wiki.codeblocks.org/index.php/Scripting_commands#IO_namespace
@obfuscated: Is it worth to extend the scripting api? I think file handling is something essential for a embedded scripting api...
oBFusCATed:
Probably it is a good idea to extend it with these capabilities.
Navigation
[0] Message Index
[*] Previous page
Go to full version