Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: eranon on December 05, 2012, 09:56:03 pm

Title: How to launch executable from bundle using the C::B RUN button ?
Post by: eranon on December 05, 2012, 09:56:03 pm
Hello. Under OSX, I can add a post-built task to run a script which will create the bundle from my fresh build. So, no problem at this step, but how to do the Codeblocks's run commands (with and without debugging) launch mycake.app/Content/MacOS/mycake ?

NB : this kind of question has already been posted on 2006 : http://forums.codeblocks.org/index.php/topic,3976.0.html, but it sounds everybody answered about post-build, but not simple run (or we consider that we run only using the build button "build even if binary is up-to-date" being checked ; but, in this case, how tu run in debug mode ?)

--
EDIT : OK, solved using execution working directory in project properties like this : "$(TARGET_OUTPUT_DIR)/$(TARGET_OUTPUT_BASENAME).app/Contents/MacOS"
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: eranon on October 30, 2013, 01:45:36 am
Hello. I'm currently back on OSX after some months outside of it and the trick I talk about above doesn't seem to work anymore... Or I'm missing a point, don't know...

Well, so, does a "Mac-man" could tell me the right way to indicate to CodeBlocks to run/debug the executable from within the bundle (ie. .app archive I produce at post-build step through a shell script) ?

Or is it the wrong way (in this case, what's the right one, please) ?

--
EDIT : awaiting to know the usual under OSX, I've worked around the problem indicating the path inside the app bundle for the "Output filename" directly. It seems to work (unless on first building since the app bundle is not already created at this time).

How do you proceed, you ?
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: eranon on March 06, 2014, 07:07:43 pm
Up.

The solution I used above doesn't seems to work anymore, I'm using currently a SVN 8909 build under OS X 10.8.

My project settings (build targets tab) are currently like this :

Code
Output filename : bin/Debug/test.app/Contents/MacOS/test
Execution working directory : bin/Debug/test.app/Contents/MacOS/

When I click the "Run" button, the log shows this and nothing seems to happen (ie. no app UI appears) :

Quote
-------------- Run: Debug in Test (compiler: FSF GCC Compiler)---------------

Checking for existence: /Users/eranon/Dev/Test/bin/Debug/test.app/Contents/MacOS/test
Executing: /Users/eranon/Dev/Test/bin/Debug/test.app/Contents/MacOS/test  (in /Users/eranon/Dev/Test/bin/Debug/test.app/Contents/MacOS/)
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: BlueHazzard on March 06, 2014, 07:50:45 pm
doest the app test exists?

Have you tried the tools menu?

greetings
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: eranon on March 06, 2014, 09:09:33 pm
Yep, the test executable is well built and moved in an app bundle (as per the path I indicate here). Right now, I just launch it from a shortcut to test.app I placed in the OSX dock (quicker than the C::B tool menu item since it's a one click only), but it would be better to run it from C::B, of course ::)
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: BlueHazzard on March 07, 2014, 06:15:18 pm
I don't think it is possible to run something else than the output file... But i don't know exactly...
it would be a interesting feature

greetings
Title: Re: How to launch executable from bundle using the C::B RUN button ?
Post by: dmoore on March 07, 2014, 06:49:26 pm
Yep, the test executable is well built and moved in an app bundle (as per the path I indicate here). Right now, I just launch it from a shortcut to test.app I placed in the OSX dock (quicker than the C::B tool menu item since it's a one click only), but it would be better to run it from C::B, of course ::)

You can set keyboard shortcuts for tool menu items