User forums > Using Code::Blocks

multiplatform GTK proyect

<< < (4/6) > >>

epsilon_da:
Thanks dmoore for your help.
I have managed to set the variables, once i have this working i will see to change the path depending on the OS, but it seems like variables inside backquotes are not parced.
I dont see variables inside backquotes on others wizards.


    project.SetVar(_T("pkg_config"), PkgConfig , false);
    project.AddCompilerOption(_T("`$(pkg_config) gtk+-2.0 --cflags --errors-to-stdout`"));
    project.AddLinkerOption(_T("`$(pkg_config) gtk+-2.0 --libs --errors-to-stdout`"));


This are the lines under "other option":

-mms-bitfields
`$(pkg_config) gtk+-2.0 --cflags --errors-to-stdout`

And this is the compilation line

mingw32-gcc.exe -Wall -mms-bitfields   -g     -c "C:\Documents and Settings\Diego_test\Escritorio\bbbbbb\main.c" -o obj\Debug\main.o


Is this what you say about that it is not outputing errors?

dmoore:
yes, looks like backticks get substituted before variable expansions (I could be wrong, haven't looked at the code). not sure what the rationale for that would be...

The other not altogether unreasonable approach to take is to expect the user to put GTK\bin in their path. (Even if they can't change the path globally, the envvars plugins allows user to set up sets of environment variables that can be assigned per project.) This is not as newbie friendly, but less bug prone than relying on scripts. You could even have a pre-build script that tries to run pkg-config and spits out an error if it couldn't be found telling the user to put it in their path.

dmoore:

--- Quote from: epsilon_da on April 09, 2009, 11:42:42 pm ---Is this what you say about that it is not outputing errors?

--- End quote ---

you don't see anything if the backtick fails to execute - C::B simply substitutes an empty string... not so good.

epsilon_da:
Thanks.
I decided to make 4 targets, 2 for unixes (and possible mac too), and 2 for MSW.
Why?
Because, if you are testing and compiling your project on multipleplatforms, the compiled object code will need to be clean when you switch of desktop and thoose, making it slower to compile and test.

Too sad to hear that "backticks get substituted before variable expansions". That will make the project configuration cleaner by setting the gtk path and other stuff as variables.

dmoore:

--- Quote from: epsilon_da on April 10, 2009, 08:45:03 pm ---Too sad to hear that "backticks get substituted before variable expansions". That will make the project configuration cleaner by setting the gtk path and other stuff as variables.

--- End quote ---

probably a trivial fix, just have to figure out if there is a good reason it does what it does.


--- Quote from: epsilon_da on April 10, 2009, 08:45:03 pm ---I decided to make 4 targets, 2 for unixes (and possible mac too), and 2 for MSW.

--- End quote ---

nice. I assume you will provide a dialog that lets the user choose which targets they want to create. (I think this is done on the other wizards)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version