I can use envireonment-variables such as $(TargetFileName) in my pre- and post-build-events. What I want to do is apply those variables to the command-line args of an external program (in my case nunit). So whenever my app starts I want to start another one with the file-name of the first as arg.
Is this possible?
When debugging my project the nunit-windows appears but shows an error-message that the given assembly $(OutDir)$(TargetFileName)$(TargetExt) could not be found. I suppose that the variables are only available during build but not during run so it seems I have to hardcode the parameters to the command-line args. Is this true?
Related
I have a very complex scons project. One of the targets include running a unittest application that is generated as part of the build.
I would like to be able to say:
scons <target> <some magic: arguments>
where some magic is something that will tell scons for which execution step the arguments are and the arguments are completely arbitrary arguments that the unittest application knows how to interpret.
the question is, is there already mechanism to do this, or I need to add code in my scons to achieve this - in both cases a pointers how to do it will be great.
Please check the User Guide at http://scons.org/doc/production/HTML/scons-user.html . You'll be interested in chapter 10 "Controlling a Build From the Command Line", which describes ways how to propagate values from the command-line to your SConscripts.
Reserve an Environment Variable, e.g. "UNITTST_ARGS", and use it to transport your arguments through to your SConscript, where you actually call your external unittest application.
Basically, what I would like to do is to first set the arguments passed on launch by editing the scheme of current target, then access those arguments in the script, which I use as the post-action script.
I know I could use many build settings variables such as PRODUCT_NAME, but still can't find one to access arguments. If it is not possible, is there a walk-around? One awkward way I am thinking is to output the arguments to a txt file in my main.mm, then read them in my script. Thanks.
In the VB6 IDE there is a window were you can specify command line arguements (for debugging). If you create a .exe with arguements specified, will they be published with the application? I don't believe they will.
No, they will not. This is just for testing your application if it uses command line arguments. It allows you to specify your command line arguments and step through exactly like if the program was called with those command line arguments.
For example, you normally pass parameters by simply calling your EXE and providing the parameters at the same time. So, if you normally call your program like such
C:\test.exe /test /inet /copy
You would simply set the command-line arguments to
/test /inet /copy
in the VB6 IDE
Is it possible to use Install[] to start a MathLink program with a custom PATH environment variable?
I am trying to use mEngine to connect Mathematica to MATLAB on Windows. It only works if mEngine.exe is launched when the PATH environment variable includes the path to the MATLAB libraries. Is it possible to modify the PATH for launching this program only, without needing to modify the system path? Or is there another way to launch mEngine.exe?
#acl's solution to wrap mEngine.exe in a batch file, and temporarily modify the PATH from there, works correctly:
I used this as the contents of mEngine.bat:
set PATH=c:\path\to\matlab\bin\win32;%PATH%
start mEngine.exe %*
*% ensures that all command line arguments are passed on to mEngine.exe
start is necessary to prevent the command window from staying open until mEngine.exe terminates
It can be started using Install["mEngine.bat"].
Since all the information that is needed for the kernel to communicate with mEngine.exe is passed by Install[] as command line arguments, all we need to do is launch mEngine.exe with these arguments. It is not necessary for Install[] to know the location of mEngine.exe, the important thing is that the process gets launched with the correct command line arguments, which is ensured by %*.
I am trying to reverse engineer the build system of a commercial Windows based IDE, so I can use make to build my project.
A program is launched to perform a task, and I need to know what command line arguments are passed to this program when it is run. However the windows process viewer does not show the command line arguments.
Is there any way to see what command line arguments are being passed when the program is launched?
(Actually it just occurred to me that I should substitute a stub program to read the command line args. Still, I'd like to know if there's an easy way).
Sysinternals Process Explorer lets you do that.