Author Topic: Confirmation before opening a Bug Report  (Read 3536 times)

Offline Xaviou

  • Regular
  • ***
  • Posts: 403
    • X@v's wxStuff
Confirmation before opening a Bug Report
« on: July 26, 2012, 09:34:05 am »
Hi
As said in the title, I would just have a confirmation on a small problem I encountered with C::B under Windows.

I've configured 2 Tools menu entries :
  • One to open an explorer window in the current project file's directory. The command of this tool is : explorer.exe ${PROJECT_DIR}
  • One to open an explorer window in the current output file's directory. The command for this one is : explorer.exe ${TARGET_OUPUT_DIR}
The first one is working properly, but the second never open the correct directory : it seems that the ${TARGET_OUPUT_DIR} macro doesn't work.

Can someone confirm this (or just tell me what I am doing wrong) ?

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Confirmation before opening a Bug Report
« Reply #1 on: July 26, 2012, 09:56:27 am »
I am not entirely sure, but:

1.) Are you sure that you actually selected a target so this macro can be evaluated?
2.) Shouldn't it be ${{TARGETS_NAME}_OUPUT_DIR}?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Confirmation before opening a Bug Report
« Reply #2 on: July 26, 2012, 10:02:30 am »
I just tested it, and it works correct.

The only "problem" is, that the path is relative to the projects directory,

You either have to prepend ${PROJECT_DIR} or use it as working directory.

Note ${PROJECT_DIR} already has a trailing backslash, so in first case you have to prepend ${TARGET_OUTPUT_DIR} directly, so it becomes:
explorer.exe ${PROJECT_DIR}${TARGET_OUTPUT_DIR}

Offline Xaviou

  • Regular
  • ***
  • Posts: 403
    • X@v's wxStuff
Re: Confirmation before opening a Bug Report
« Reply #3 on: July 26, 2012, 10:59:01 am »
Hi, and thank you for your responses.
2.) Shouldn't it be ${{TARGETS_NAME}_OUPUT_DIR}?
I just used the macro shown in the "Edit tool" dialog box.

I just tested it, and it works correct.

The only "problem" is, that the path is relative to the projects directory
Sorry, I didn't thought it could be.

so it becomes:
explorer.exe ${PROJECT_DIR}${TARGET_OUTPUT_DIR}
It works perfectly. Thank-you.

Hmmm : shame on me  :-[
The problem wasn't here : just have a look at what I wrote : even if I checked several times the typo of the macro, I made an error (a missing T in OUTPUT).

@Jens : the ${TARGET_OUTPUT_DIR} macro can be alone, without the ${PROJECT_DIR} one, even if the output directory is written as relative to the project dir in the project properties.

Again, I apologize for this.
Regards

Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Confirmation before opening a Bug Report
« Reply #4 on: July 26, 2012, 11:16:13 am »
Hmmm : shame on me  :-[
The problem wasn't here : just have a look at what I wrote : even if I checked several times the typo of the macro, I made an error (a missing T in OUTPUT).
that's why I marked the T red in my previous post.

@Jens : the ${TARGET_OUTPUT_DIR} macro can be alone, without the ${PROJECT_DIR} one, even if the output directory is written as relative to the project dir in the project properties.
In the project I tested I need to prepend it.
It's a web-project, on a network-drive in windows, without any executables.
Probably the working directory used for wxExecute is only set if the project/target is build, or if it was set explicitely in the tools configuration.

There is also a TO_ABSOLUT_PATH-macro, that creates an absolute path in C::B's executable folder and not in the projects base-path, but that's another story.