Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: Seronis on March 05, 2008, 05:25:04 pm
-
It would be useful if you could have a uniform command that would launch a console window with a primary working directory set to where the current targets executable gets saved. Mostly when im working on quick test projects that require/allow command line arguments i dont want to have to edit the project to alter the default arguments for testing. If a button would just pop open a window where i need to be (some paths are annoying to navigate to) and that path would be accurate regardless of build target (thus diff build directory) it would be most useful.
-
It would be useful if you could have a uniform command that would launch a console window with a primary working directory set to where the current targets executable gets saved.
You can simply setup a tool that does so. Open a cmd.exe (the "tool") ansd specify the patch where this shall be opened.
See: Menu "Tools" -> "Configure tools..."
I have setup cmd.exe there (for example) with "${PROJECT_DIR}" as working directory.
-
For Windows XP there is also a (free) Microsoft PowerToy Called "Open Command Window Here" which allows you to right click on any directory in Explorer and open a console window in that directory.
-
I have setup cmd.exe there (for example) with "${PROJECT_DIR}" as working directory.
But doesnt that just go to the project directory? Is there some macro that goes to the binary directory? I have projects that place the binary in one of several different tools directories, sometimes on removable media, that are not always gaurenteed to even be on the same drive as the project. I would still like the cmd window to open to the appropriate place based on where the binary is created.
I'll do a test when I have access to my C::B installation to double check but im thinking setting up the tool like that would work if a ${BINARY_DIR} gets added to the environment that always resolves to the correct location.
-
For Windows XP there is also a (free) Microsoft PowerToy Called "Open Command Window Here" which allows you to right click on any directory in Explorer and open a console window in that directory.
That still requires me to leave the build environment and already have the target directory open. Instead of being a quick-clickable button accessible from within the IDE, that automatically can determine the binary location based on project settings. Really looking for a one-step solution =-)
As a side note, the functionality you mention is built into Vista by default with no special tools required. I think this is the first nice thing i have EVER noticed about vista. Actually make that 2nd, with the mingw installation of C::B being vista friendly it has 2 nice things about it.
-
I'll do a test when I have access to my C::B installation to double check but im thinking setting up the tool like that would work if a ${BINARY_DIR} gets added to the environment that always resolves to the correct location.
Try "${TARGET_OUTPUT_DIR}" .
You can also use the keybinder-plugin to create a keyboard-shortcut to your new menu entry.
-
Try "${TARGET_OUTPUT_DIR}" .
Amen.
You see a list of the most important macros in the tool config dialog already. ${PROJECT_DIR} was just an example of how I do it - as for me this is also the "top level" directory where I am starting my apps from.
-
Thank you both, very helpful =-)