Author Topic: Pre-Build Steps  (Read 2789 times)

Offline JNo

  • Single posting newcomer
  • *
  • Posts: 7
Pre-Build Steps
« 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 ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Pre-Build Steps
« Reply #1 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]