Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: JNo on September 30, 2020, 03:25:11 pm

Title: Pre-Build Steps
Post by: JNo on September 30, 2020, 03:25:11 pm
Hi,

I use Code::Blocks on WIN10.

I have a workspace with several projects.

On each build of project I want to display the relative project directory from workspace directory.

In fact I add in Pre-Build steps I add:
cmd /c @echo cd $(PROJECT_DIR)

But $(PROJECT_DIR) is a absolute path.

How I can display an relative path ?
Title: Re: Pre-Build Steps
Post by: oBFusCATed on September 30, 2020, 09:07:38 pm
http://wiki.codeblocks.org/index.php/Scripting_commands
Probably wxFileName.MakeRelativeTo would work.

I guess you can make it work following this http://wiki.codeblocks.org/index.php/Variable_expansion#Script_expansion