Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on February 04, 2025, 03:26:23 am

Title: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 04, 2025, 03:26:23 am
Hi, when I try to build the whole C::B workspace against the "debug version of the wxWidgets", I need to change the "custom variable" named "WX_SUFFIX" from "u" to "ud".

This is simple if I only need to change this value in a single "cbp" file, but if I want to change them in all the cbps under the workspace, how to do that? I don't want to open the build option dialog for each cbp files.

Thanks.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: Wkerry on February 04, 2025, 08:35:47 am
Have a look at https://github.com/gerard-durand/codeblocks_gd_cbps as an example of how to do it for Windows only. This may save you some time.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: LETARTARE on February 04, 2025, 10:12:58 am
It seems to me that using the 'Plugin->Project options manipulator' extension should solve your workspace problem.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 04, 2025, 03:44:33 pm
Hi, @LETARTARE thanks. This is my first time to use this project options manipulator plugin, this plugin works. I can change all the "u" to "ud" for the "WX_SUFFIX" custom variable, great!

@Wkerry thanks, I see the gd's cbp file is a unified version for all windows versions and wx versions, this is also a great work! Why not put them to our SVN code base? Any devs opinion?  :)
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: Miguel Gimenez on February 04, 2025, 04:54:20 pm
IMHO, now wxWidgets 3.3 is near we can try gd_on's files, keeping current 3.0 (Linux only), 3.1 and 3.2 projects (just in case).
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 05, 2025, 03:55:01 am
IMHO, now wxWidgets 3.3 is near we can try gd_on's files, keeping current 3.0 (Linux only), 3.1 and 3.2 projects (just in case).

OK, I agree.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 05, 2025, 03:57:54 am
I found that the project manipulate plugin does not work well.
Here is my setting, see the attachment image.

And the result is:

Code
Project 'Code::Blocks wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'tinyXML': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'AutoRevision': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'ConsoleRunner': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Squirrel': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'scintilla': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'sdk': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'src': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Abbreviations': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'AStyle': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Autosave': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Compiler depslib': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Compiler': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Debugger': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Code-completion': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Class wizard': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Default MIME handler': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Occurrences Highlighting': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Open files list': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Projects-workspaces importer': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'Scripted wizard': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'To-do': Replaced custom var 'u'.
Project 'Code::Blocks wx3.2.x (64 bit)', target 'XP look & feel': Replaced custom var 'u'.
Project 'Addr2LineUI wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Addr2LineUI wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Code::Blocks Share Config wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Code::Blocks Share Config wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'CbLauncher wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'CbLauncher wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'cbp2make wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'cbp2make wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'cbp2make wx3.2.x (64 bit)', target 'Doxygen': Replaced custom var 'u'.
Project 'CC Test wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'CC Test wx3.2.x (64 bit)', target 'cctest': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxFlatNoteBook': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxChartCtrl': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxCustomButton': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxImagePanel': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxSpeedButton': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxKWIC': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxLED': Replaced custom var 'u'.
Project 'wxWidgets - Contrib Items wx3.2.x (64 bit)', target 'wxMathPlot': Replaced custom var 'u'.
Project 'wxSmith wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'wxSmith wx3.2.x (64 bit)', target 'wxSmithLib': Replaced custom var 'u'.
Project 'wxSmith wx3.2.x (64 bit)', target 'wxSmith': Replaced custom var 'u'.
Project 'wxSmith - Contrib Items wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'wxSmith - Contrib Items wx3.2.x (64 bit)', target 'wxSmithContribItems': Replaced custom var 'u'.
Project 'wxSmith - wxAUI wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'wxSmith - wxAUI wx3.2.x (64 bit)', target 'Default': Replaced custom var 'u'.
Project 'headerguard wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'headerguard wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'LogHacker wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'LogHacker wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'ModPoller wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'ModPoller wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'tidycmt wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'tidycmt wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'AutoVersioning wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'AutoVersioning wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'BrowseTracker wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'BrowseTracker wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Games wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Games wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Koders Query wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Koders Query wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Cccc wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Cccc wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Code Snippets wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Code Snippets wx3.2.x (64 bit)', target 'Plugin - Win32': Replaced custom var 'u'.
Project 'Code Stat wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Code Stat wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'CopyStrings wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'CopyStrings wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'CppCheck/Vera++ wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'CppCheck/Vera++ wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Cscope wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Cscope wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'DevPak wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'DevPak wx3.2.x (64 bit)', target 'libbz2': Replaced custom var 'u'.
Project 'DevPak wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'DoxyBlocks wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'DoxyBlocks wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'DragScroll wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'DragScroll wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'EditorConfig wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'EditorConfig wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'EditorTweaks wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'EditorTweaks wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'EnvVars wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'EnvVars wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'EnvVars wx3.2.x (64 bit)', target 'no_pch': Replaced custom var 'u'.
Project 'FileManager Plugin wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'FileManager Plugin wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'HeaderFixup wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'HeaderFixup wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Help wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Help wx3.2.x (64 bit)', target 'bzip2': Replaced custom var 'u'.
Project 'Help wx3.2.x (64 bit)', target 'zlib': Replaced custom var 'u'.
Project 'Help wx3.2.x (64 bit)', target 'help_plugin': Replaced custom var 'u'.
Project 'HexEditor wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'HexEditor wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'IncrementalSearch wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'IncrementalSearch wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'KeyBinder wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'KeyBinder wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Library finder wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Library finder wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'MouseSap wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'MouseSap wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Profiler wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Profiler wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'ProjectOptionsManipulator wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'ProjectOptionsManipulator wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'RegExTestbed wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'RegExTestbed wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'ReopenEditor wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'ReopenEditor wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'rndgen wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'rndgen wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Clangd_Client wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Clangd_Client wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentCpp': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentHDL': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentPascal': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentPython': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentLua': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentFortran': Replaced custom var 'u'.
Project 'SmartIndent wx3.2.x (64 bit)', target 'SmartIndentXML': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)', target 'wxPdfDocument': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)', target 'makefont': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)', target 'minimal': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)', target 'pdfdc': Replaced custom var 'u'.
Project 'Exporter wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'SpellChecker wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'SpellChecker wx3.2.x (64 bit)', target 'hunspell': Replaced custom var 'u'.
Project 'SpellChecker wx3.2.x (64 bit)', target 'wxSpellChecker': Replaced custom var 'u'.
Project 'SpellChecker wx3.2.x (64 bit)', target 'plugin': Replaced custom var 'u'.
Project 'SymTab wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'SymTab wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'ThreadSearch wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'ThreadSearch wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.
Project 'Tools Plus Plugin wx3.2.x (64 bit)': Replaced custom var 'u'.
Project 'Tools Plus Plugin wx3.2.x (64 bit)', target 'default': Replaced custom var 'u'.

Also, it is prompted that I need to save all the project files, so I press YES button.

But I see that the WX_SUFFIX value are still "u".

 :(

EDIT

If I check on the "replace only search pattern", the issue still exists.

Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 05, 2025, 04:40:37 am
OK, I finally found the solution by debugging the source code of this plugin.

I have to do like below (see attachment)

The text control pointed by blue arrow could be empty.

The right red arrow points to the new value of the custom var, and the left red arrow points to the var name.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: Wkerry on February 05, 2025, 09:15:01 am
@Wkerry thanks, I see the gd's cbp file is a unified version for all windows versions and wx versions, this is also a great work! Why not put them to our SVN code base? Any devs opinion?  :)

GD's repo started a long time ago and there was a post in 2024. It makes life allot easier as you have indicated. See https://sourceforge.net/p/codeblocks/tickets/1332/ for an old patch that seems to have not been looked at.
Title: Re: How to globally set the "custom variables" in the cbp files under a workspace
Post by: ollydbg on February 05, 2025, 09:47:19 am
@Wkerry thanks, I see the gd's cbp file is a unified version for all windows versions and wx versions, this is also a great work! Why not put them to our SVN code base? Any devs opinion?  :)

GD's repo started a long time ago and there was a post in 2024. It makes life allot easier as you have indicated. See https://sourceforge.net/p/codeblocks/tickets/1332/ for an old patch that seems to have not been looked at.

That's great, thanks for the info, I think the devs should take some time to add his patch to the svn repo.