> Viktor Szakáts wrote:
>> 
>> I'm sorry, but I can't see why this would be necessary, moreover, 
>> I doubt it would work this way. If hbmk2 invokes a subprocess, 
>> such as vcvarsall.bat, I see no way that the environment it leaves 
>> behind could be kept for compiler tools invoked afterwards.
>> 
> 
> Oh, I forgot this fact. It is the same for hbMK2 as is hbMK2
> is for hbIDE. Damm...
> 
> 
> 
>> If you need such functionality I think you should pack all 
>> your commands (call vcvarsall && hbmk2 ...) in one .bat / .sh 
>> file (depending on host platform) or one commandline with multiple 
>> commands, and invoke that. Also notice that in order to make 
>> "%ProgramFiles%" expression work, you definitely need to 
>> invoke the OS shell.
>> 
> 
> This can be the option but not very elegant. hbIDE does not 
> need anything special. All what is required is how to make hbMk2
> happy to execute a project. The only point is user cannot set the
> environment beforehad. hbIDE can be invoked from anywhere.

I don't think the shell trick is inelegant. Using 
the shell isn't something prohibited, it needs 
a little bit different code for a few different kind 
of platforms (win/dos, os2, *nix), but nothing heavy.

Certainly better than inventing a new little script 
language.

>> The other option is to stick to envvars, and in this case 
>> you can set these using hb_setenv() before invoking hbmk2 
>> subprocess. (I do this in hbmk2 to setup some tools automatically)
>> I don't know if this works with QProcess.
>> 
> Setting env variable works with QProcess.
> So, if my batch to invoke console for MSVS looks like this :
> 
> //----------------------//
> 
> call "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
> 
> SET PATH=e:\harbour;e:\harbour\bin;c:\mingw\bin;c:\qt\4.5.3\bin;%PATH%
> 
> set HB_ARCHITECTURE=win
> set HB_COMPILER=msvc

Please drop these. They are not needed.

> 
> set HB_WITH_QT=c:\qt\4.5.3\lib
> 
> set HB_USER_PRGFLAGS=-gc3

Also not needed, you can simply pass it to hbmk2 directly.

> //----------------------//
> 
> Then what I am supposed to pass hbMK2 from hbIDE that 
> above setting is known to hbMK2.
> All set commands I can set but what about "call" command?
> Is it necessary ? Or we have another option ?

No, if you use the setenv method, you can't use anthing 
which is shell cmd processor specific, like 'call', 
'%variable%', etc.

It looks insufficient for proper environment support, 
since users can't use their own init batches, plus such 
things as vcvarsall.bat.

I'd vote for the .bat/.sh creation / execution method.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to