Yiannis, what did you do with C::B to solve this problem? I never needed to ask.
Example: In your project settings:
Under "Compiler settings", "other options":Code[[if (PLATFORM == PLATFORM_MSW) print(_T("-mthreads -D__GNUWIN32__ -D__WXMSW__"));;]]
`wx-config --cflags`
(Note: The double ;; at the end is a workaround a scripting bug)
As you can see, the one-line script is pretty much like C. the _T must have been incorporated for wxWidgets compatibility. In any case, Notice the compilation string: -mthreads, -D__GNUWIN32__ and -D__WXMSW__. The -D is a compiler define. I tried to add scripting to the #defines, but that didn't work, so I had to add them on the compiler command line.
The wx-config part is for Linux. I've found that experimentally, having this option in the project doesn't affect compilation under Windows.
The same can be done with the linker. Under Linker settings, other linker options:Code[[if (PLATFORM == PLATFORM_MSW) print(_T("-mthreads -lwxmsw28u -lintl.dll"));;]]
`wx-config --libs`
Here I tell the linker to link two windows-only libraries: libwxmsw28u.a, and libintl.dll.a (libintl is used for internationalization). For posix environments (OS X or GNU/Linux), the backticked expressions are more than enough, but you could do the same with "if (PLATFORM != PLATFORM_MSW).
Under search directories, I add both the Windows and posix directories.
Compiler search dirs:Code$(#wx.include)
$(#wx)/contrib/include
$(#wx)/lib/gcc_dll/mswu
Linker search dirs:Code$(#wx)/lib/gcc_dll
Resource Compiler search dirs:Code$(#wx.include)
$(#wx)/lib/gcc_dll/mswu
With this simple settings, you won't require having two different projects, one for GNU/Linux or Mac OS, and another for Windows.
So I would prefer (once asked the script project guru) to have a project wizard which creates the 4 targets, when done automatically I think I will be much clearer to the user and who knows what kind of defines might need to be added later on in platform a but not in platform b [you would always have to start scripting] or when you create projects where on platform a you need a special file A and on platform b you should not use file A but file B. Will be harder to maintain.
ADDED:
I found how to create different targets... Project->Properties->Build targets and Add/Duplicate ...
But I found that in .cbp we have only one set of compiler options, and they incompatible on different platforms!
Please, help me, how to put two sets of compiler options in ONE project???
One for windows and one for Linux and assign that options to correct build targets?..
BUT... unfortunately, I need additional _manual_ editings of .cbp file to get all this work fine...Huh? I don't get this. ALL parameters in a project file are configurable via the project / target settings. What exactly do you modify in the cbp file by hand?
I created project in windows and then I added new build target under Linux. I edited compiler parameters for new target to make them suitable for Linux. And... In .cbp file, in common to all targets sections you can see:BUT... unfortunately, I need additional _manual_ editings of .cbp file to get all this work fine...Huh? I don't get this. ALL parameters in a project file are configurable via the project / target settings. What exactly do you modify in the cbp file by hand?
- <Compiler>
<Add option="-pipe" />
<Add option="-mthreads" />
<Add option="-D__GNUWIN32__" />
<Add option="-D__WXMSW__" />
This is _manual_ editing...I believe we have a different understanding of "manual editing". So let me ask more precise:
Yes, I use editor and write necessary XML nodes... This is _without C::B_ (unfortunately) =(This is _manual_ editing...I believe we have a different understanding of "manual editing". So let me ask more precise:
Do you use C::B only to setup the project options using the setup dialog of C::B or...
...do you open the CBP file directly in an editor (whatever editor) and paste XML nodes into it?
Yes, I use editor and write necessary XML nodes... This is _without C::B_ (unfortunately) =(Please show me the nodes you are adding / modifying manually and I show you where the UI counterpart is. As I said: *All* settings are available via the UI options.
I created project under windows.Yes, I use editor and write necessary XML nodes... This is _without C::B_ (unfortunately) =(Please show me the nodes you are adding / modifying manually and I show you where the UI counterpart is. As I said: *All* settings are available via the UI options.
So, as you can see, if project creation wizard creating project it makes it NON-crosplatform...So - that's your actual problem. So why don't you just adjust the wizard? It's very simple! And that would be the *right* way to do.
AND even if you can do this in c::b GUI, I think it is not normal to do this manuallyI don't think so. You can easily copy whole settings from the project level to a target level. This is usually one mouse click with an "OK". If that is too much work for you... OK - do it manually.
All I wanted to know if we are missing something in the UI but we don't.You are developer of c::b? Please, explain me how to "adjust wizard" (I cant see platforms selection in wizard), how to copy "from project level to target level"??? I'ill write micro-howto about this topic... Then, I hope, I will try to add crossplatform wizard for c::b...
Please, explain me how to "adjust wizard"- Menu File -> New -> Project
how to copy "from project level to target level"???- Right click on the project, select "Build options..."
So I would prefer (once asked the script project guru) to have a project wizard which creates the 4 targets, when done automatically I think I will be much clearer to the user and who knows what kind of defines might need to be added later on in platform a but not in platform b [you would always have to start scripting] or when you create projects where on platform a you need a special file A and on platform b you should not use file A but file B. Will be harder to maintain.
Sorry for the delay. But unfortunately I don't get much time to code nowadays. I am redesigning the wizard to some extent. This is how it looks right now.
(http://img75.imageshack.us/img75/3871/newwizardrv8.th.png) (http://img75.imageshack.us/my.php?image=newwizardrv8.png)
But the coding is not complete yet.