User forums > Using Code::Blocks

Wildcards in paths of files in a project?


Hello Code::Blocks community,

this is my first post. I would like to know if the Code::Blocks IDE supports wildcards like the Visual Studio IDE does. It is a helpful feature so that the project file does not have to be changed in case a new source code file was added to the source folder.

Example to add all .cpp files recursively in the "src" folder:
<Unit Filename="src/**/*.cpp" />

Example to add all .cpp files just in the "vendor" folder:
<Unit Filename="vendor/*.cpp" />

This is a great IDE! Keep up the good work.

- Martin

Yes, but there is no GUI support for this feature as far as I know.

See here for details:

Thank you very much, oBFusCATed ! This is exactly what I was looking for.

So using the examples provided by killerbot, my examples be written like this:

<UnitsGlob directory="src" wildcard="*.cpp" recursive="1" />
<UnitsGlob directory="vendor" wildcard="*.cpp" recursive="0" />

Confirmed working! See this example CBP file:
This is great news! I feel confident about adding Code::Blocks projects as alternative build method. You know how makefiles have problems with spaces in paths? This is not a problem with Code::Blocks projects, am I right?

Despite you mentioning "no GUI support" killerbot has claimed that the file entries do show up in the GUI, at least. By reloading the project you get the recent file list aswell. This sounds like everything I would ever need anyway! :)


Related but different, I would like to report a bug. When importing a MSVC project that has wildcard file entries, Code::Blocks does not resolve them.

--- Code: ---<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="">
  ( ... )
    <Natvis Include="peloader.natvis" />
    <ClCompile Include="..\src\**\*.cpp" />
    <ClInclude Include="..\include\**\*.h" />
    <ClInclude Include="..\src\**\*.h" />
    <ClInclude Include="..\src\**\*.hxx" />
  ( ... )

--- End code ---

Since Code::Blocks does have support for such things, could somebody please add support for the MSVC style wildcard aswell?

- Martin

EDIT: fixes for the examples, etc.

For bug reports the bug tracker on SF is the better place... Bugs reported in the forum will get lost...

@BlueHazzard: I have posted a ticket here:
Using my pseudo-account.

Would really appreciate if you guys check it out.

- Martin


[0] Message Index

Go to full version