User forums > Using Code::Blocks

How to launch executable from bundle using the C::B RUN button ?

(1/2) > >>

eranon:
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"

eranon:
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 ?

eranon:
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/
--- End code ---

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/)
--- End quote ---

BlueHazzard:
doest the app test exists?

Have you tried the tools menu?

greetings

eranon:
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 ::)

Navigation

[0] Message Index

[#] Next page

Go to full version