User forums > Using Code::Blocks
Run shell script with the "Run" button
Yargh:
I am currently working on a C::B project that requires custom tools to build and run (Compiles with a makefile through cygwin). Since it needs a custom command line to run, and cannot be run from an executable, I am wondering: Is it possible to have the "Run" button call a custom script instead of run an executable? What I am currently doing is I added "make run" to the post-build custom build steps, but that doesn't work if I want to compile but not run the project.
Jenna:
You can try to create a batchfile (I guess you are on windows, because you use cygwin, on linux use a shell-script) that calls the commands you need and set it as "Output filename" in the projects "Properties -> Build targets -> [the target you use]".
Jenna:
What I forgot:
you most likely have to uncheck "Auto-generate filename prefix" and "Auto-generate filename extension" .
dmoore:
Can't OP also goto "Project -> Set Programs' Arguments" and set the "Host Application"?
Jenna:
--- Quote from: dmoore on March 19, 2011, 08:39:46 pm ---Can't OP also goto "Project -> Set Programs' Arguments" and set the "Host Application"?
--- End quote ---
In this case he has to declare the application as dynamic or static library, but he would have to set up a terminal to run it in (if console output is needed) on his own.
Using the script as "Output filename" works better in my opinion. At least in custom makefile projects, in C::B projects the script would be overwritten during the build (of course).
Navigation
[0] Message Index
[#] Next page
Go to full version