News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

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

Started by eranon, December 05, 2012, 09:56:03 PM

Previous topic - Next topic

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.next.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"
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

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 ?
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

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 :

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/)
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

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 ::)
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

BlueHazzard

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

dmoore

Quote from: 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 ::)

You can set keyboard shortcuts for tool menu items
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]