Author Topic: Problem with Tool variables  (Read 4635 times)

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Problem with Tool variables
« on: October 30, 2006, 02:31:10 pm »
I want to put output executable file name in Parameters text box in edit tool menu and I tried out all variable names that I found that I thought that would do the trick but unfortunately none of them sim to work  :( I'm not sure if I missed one of the variables or if this is even possible at the moment. I'm using Linux FC5 and I'm not using latest night builds.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problem with Tool variables
« Reply #1 on: October 30, 2006, 03:00:27 pm »
you can use the Tools Menu and pass the macros

$(TARGET_OUTPUT_DIR)
$(TARGET_OUTPUT_FILE)


e.g.

Executable: usr/bin/Simulatorxy
Parameters: flags, $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_FILE)


you need to activate the target in order to get the filename

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Problem with Tool variables
« Reply #2 on: October 30, 2006, 03:09:13 pm »
Quote
you need to activate the target in order to get the filename

What do you mean by that? I compile the project and if I write the filename directly in the parameters field it works but if I write $(TARGET_OUTPUT_FILE) instead then it doesn't work. It seems as if this variable would return an empty string.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problem with Tool variables
« Reply #3 on: October 30, 2006, 05:01:00 pm »
Quote
if I write $(TARGET_OUTPUT_FILE) instead then it doesn't work

Try $([your_target_name]_OUTPUT_FILE) replacing [your_target_name] with, err, your target's name (title, e.g. default).
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Problem with Tool variables
« Reply #4 on: October 30, 2006, 05:27:00 pm »
Quote
you need to activate the target in order to get the filename

What do you mean by that?

use Menu Build -> Select target ... -> choose your target
or
use the "Build target" dopdown list and select (==activate) your target

Offline DoMeN

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Problem with Tool variables
« Reply #5 on: November 02, 2006, 09:13:46 am »
Tnx. That works now but now I have a new problem  :?. When I use $(RELEASE_OUTPUT_FILE) I get the name of output file which is ok. But when I use $(RELEASE_OUTPUT_DIR) I get the path to project file directory and not the path to the sub directory where the release file is. In menu "Project/target options" I wrote in the "output filename" text box the name of the executable and in the "Execution working dir" text box I wrote ./path_to_the_executable.
If I also write the path to the executable in the output filename then I have a problem that I can use the path only for the executable and not also for other files that need that path.
I'd really need the whole path to the executable in the tool "working directory" text box or a variable with the path to the sub folder but without the executable file name.
« Last Edit: November 02, 2006, 09:17:34 am by DoMeN »