Code::Blocks Forums

User forums => Help => Topic started by: Andrej08 on June 12, 2010, 10:30:53 pm

Title: Running the executable with a custom tool (Windows)
Post by: Andrej08 on June 12, 2010, 10:30:53 pm
Hi,

A quote from an older thread:
I want to use cygwin(can display UTF-8 encoding correctly) as my default console program output.
This is not supported directly. Windows does have exactly one console.

But: You can use the tools menu just fine. Add the Cygwin console as new "tool" and link it with the project's application (there is a macro provided for this purpose). This way you can run *any* project's executable using the Cygwin console just fine.

I'm trying to set up Console2 (http://sourceforge.net/projects/console/) on Windows to run the built executable (on codeblocks v10.05). I've added the tool to the tools menu, but I'm not sure how to link the project to use it. What is this macro that MortenMacFly speaks of?

Btw., you guys have done a fantastic work on this new release!

Cheers.
Title: Re: Running the executable with a custom tool (Windows)
Post by: stahta01 on June 13, 2010, 01:22:59 am
Example of some on Wiki
http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

Looking for a list; found a list in user manual
http://www.codeblocks.org/docs/main_codeblocks_en.html

Look under "Variable Expansion" and Listing 3.2 and Listing 3.4

I think 3.4  Command Macros is the one you want.

Tim S.
Title: Re: Running the executable with a custom tool (Windows)
Post by: Andrej08 on June 13, 2010, 07:46:34 pm
Example of some on Wiki
http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

Looking for a list; found a list in user manual
http://www.codeblocks.org/docs/main_codeblocks_en.html

Look under "Variable Expansion" and Listing 3.2 and Listing 3.4

I think 3.4  Command Macros is the one you want.

Tim S.
Example of some on Wiki
http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

Looking for a list; found a list in user manual
http://www.codeblocks.org/docs/main_codeblocks_en.html

Look under "Variable Expansion" and Listing 3.2 and Listing 3.4

I think 3.4  Command Macros is the one you want.

Tim S.

Woops! Somehow I ended up in the advanced compiler settings for a minute there. *facepalm*

I've got it set up now, I've set up the paramaters for the Console tool like so:

Code
-d ${PROJECT_DIR} -r "/k $(PROJECT_DIR}$(TARGET_OUTPUT_FILE}"

It doesn't work when the project dir has empty spaces, but that's a Windows/Console issue. Anyway, thanks for your help!
Title: Re: Running the executable with a custom tool (Windows)
Post by: stahta01 on June 13, 2010, 08:31:21 pm

Code
-d ${PROJECT_DIR} -r "/k $(PROJECT_DIR}$(TARGET_OUTPUT_FILE}"

It doesn't work when the project dir has empty spaces, but that's a Windows/Console issue. Anyway, thanks for your help!

The below might work with spaces; untested.

Code
-d "${PROJECT_DIR}" -r /k "$(PROJECT_DIR}$(TARGET_OUTPUT_FILE}"

Tim S.
Title: Re: Running the executable with a custom tool (Windows)
Post by: Andrej08 on June 13, 2010, 09:09:48 pm

Code
-d ${PROJECT_DIR} -r "/k $(PROJECT_DIR}$(TARGET_OUTPUT_FILE}"

It doesn't work when the project dir has empty spaces, but that's a Windows/Console issue. Anyway, thanks for your help!

The below might work with spaces; untested.

Code
-d "${PROJECT_DIR}" -r /k "$(PROJECT_DIR}$(TARGET_OUTPUT_FILE}"

Tim S.
Yeah, I've already tried that. But I think there's a bug in the Console tool itself. If I get it working I'll post it here.