Author Topic: How to launch executable from bundle using the C::B RUN button ?  (Read 5965 times)

Offline eranon

  • Almost regular
  • **
  • Posts: 180
How to launch executable from bundle using the C::B RUN button ?
« 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"
« Last Edit: December 05, 2012, 11:48:28 pm by eanon »
[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"]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #1 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 ?
« Last Edit: October 30, 2013, 02:02:04 am by eranon »
[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"]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #2 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/)
« Last Edit: March 06, 2014, 07:20:44 pm by eranon »
[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"]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #3 on: March 06, 2014, 07:50:45 pm »
doest the app test exists?

Have you tried the tools menu?

greetings

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #4 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 ::)
[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"]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #5 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

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: How to launch executable from bundle using the C::B RUN button ?
« Reply #6 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