User forums > Using Code::Blocks
Confirmation before opening a Bug Report
(1/1)
Xaviou:
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'
MortenMacFly:
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}?
Jenna:
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}
Xaviou:
Hi, and thank you for your responses.
--- Quote from: MortenMacFly on July 26, 2012, 09:56:27 am ---2.) Shouldn't it be ${{TARGETS_NAME}_OUPUT_DIR}?
--- End quote ---
I just used the macro shown in the "Edit tool" dialog box.
--- Quote from: jens 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
--- End quote ---
Sorry, I didn't thought it could be.
--- Quote from: jens on July 26, 2012, 10:02:30 am --- so it becomes:
explorer.exe ${PROJECT_DIR}${TARGET_OUTPUT_DIR}
--- End quote ---
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'
Jenna:
--- Quote from: Xaviou on July 26, 2012, 10:59:01 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).
--- End quote ---
that's why I marked the T red in my previous post.
--- Quote from: Xaviou on July 26, 2012, 10:59:01 am ---@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.
--- End quote ---
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.
Navigation
[0] Message Index
Go to full version