Setting up Visual Studio 6 IDE for MDL- notes

 

by Gary Jung  http://www.giffels.com

to Step 3. Creating MDL Project

Press OK. Next wizard dialog asks for Command line for DEBUG
configuration. Visual Studio has basically two configuration for running compilation process:
Debug used for  debug compilation, and Release, used for final release code.

[[REMOVE THIS: Although you may use them for compilation, I would
recommend to use only one configuration and directly edit batch and make file for
any necessary changes in build process.]]

First, for the "Win32 Debug" setting, delete any content at the Command
line entry and type your project name plus .bat extension (optional), for instance
treexmpl.bat, and add "DEBUG" after it, so it looks like "treexmpl.bat DEBUG".  This
will be a batch file for running MicroStation compilation, and using DEBUG as an
argument to the batch file. Then type into the Output your final application
name, e.g. treexmpl.ma, and you may leave Rebuild All Switch as it is (/a). Repeat
this for the "Win32 Release" setting, but use a Command line of "treexmpl.bat
RELEASE". Then Press the Finish button.


Then for your example MDLVARS.BAT (mine is called makeMyMDL.bat), the
lines to process the DEBUG and RELEASE and rebuild all arguments can be like the follow.
Note, it is mostly fluff and comments...for each MDL application I simply change the
very last line to suit the application name.

++++++++++++++++++++ START OF makeMyMDL.bat +++++++++++++++++++++
::@echo off

:: ===========  makeMyMDL.bat =============
:: This batch file is meant to be used by a call from the MS Dev Studio
:: but may also be used from regular command line building.
::
:: Author: Gary Jung, Giffels Associates Ltd.  Oct 2001
::

:: Background info for setting up MDL project in MS Dev
:: Set up a workspace, then set up a project for a 'Makefile'. Set the
:: Debug build to be "makeMyMDL.bat DEBUG", rebuild all option "/a"
:: Release build to be "makeMyMDL.bat RELEASE", rebuild all option "/a"
:: Dev Studio will be set up to send these args:

:: If [Win32 Release]...F7 - regular build - "RELEASE"
:: If [Win32 Release]...Rebuild All        - "RELEASE /a"

:: If [Win32 Debug]...F7 - regular build   - "DEBUG"
:: If [Win32 Debug]...Rebuild All          - "DEBUG /a"
echo %0 [%1] [%2]

:: Careful, DOS batch is case sensitive for args.  Add code to
:: test case-insensitive if you wish, for now assume project has
:: been set up with UPPERCASE "RELEASE" and "DEBUG" and "/a"
:: We will test for "RELEASE" or "release" but no others.

:: First, unset debug and buildAll OS ENV VARs, so that we default
:: to building Release and a regular build (not rebuild all).
set debug=
set buildAll=

:testForDebug

:: If no %1 arg, assume it's running from cmd line, run as RELEASE
if !%1!==!! goto startMake

:: If we find DEBUG, go set debug OS ENV VAR
if !%1!==!DEBUG! goto setDebug
if !%1!==!debug! goto setDebug

:: If we made it here, it's RELEASE or some other garbage arg,
:: Just run as if RELEASE.
goto testForBuildAll


:setDebug
set debug=1

:testForBuildAll
:: Shift args now to test next for /a.
shift

if !%1!==!! goto startMake

if !%1!==!/a! goto setBuildAll
if !%1!==!-a! goto setBuildAll
if !%1!==!-A! goto setBuildAll
if !%1!==!/A! goto setBuildAll
goto startMake

:setBuildAll
set buildAll=-a

:startMake
date /t
time /t
SET MS=C:\BentleyV8\Program\MicroStation
:: ECHO all MS* OS ENV VARs
SET MS

:: Setup MS VC environment
call vcvars32.bat

SET INCLUDE=%MS%\mdl\include;%INCLUDE%
SET LIB=%MS%\mdl\library;%MS%\jmdl\lib;%LIB%
set BMAKE_OPT=-I%MS%\mdl\include -I%MS%\jmdl\include
set PATH=;%MS%;%MS%\mdl\bin;%MS%\jmdl\bin;%PATH%
set MLINK_STDLIB=%MS%\mdl\library\builtin.dlo
%MS%\mdl\library\dgnfileio.dlo
%MS%\mdl\library\toolsubs.dlo

bmake %buildAll% myMdl.mke

++++++++++++++++++++ END OF makeMyMDL.bat +++++++++++++++++++++