2009-02-01 01:19:54 +05:00
|
|
|
REM *********************************************************************************
|
|
|
|
REM *** Netgen Windows Post-Build Script
|
|
|
|
REM *** Author: Philippose Rajan
|
|
|
|
REM *** Date: 31/01/2009
|
|
|
|
REM ***
|
|
|
|
REM *** Used to perform an "Install" of the generated executable
|
|
|
|
REM *** along with the required *.tcl files
|
|
|
|
REM ***
|
2009-02-16 01:25:44 +05:00
|
|
|
REM *** Call from Visual C++ using:
|
|
|
|
REM *** postBuild_netgen.bat $(ProjectName) $(TargetFileName) $(ConfigurationName) $(ProjectDir)
|
2009-02-01 01:19:54 +05:00
|
|
|
REM *********************************************************************************
|
|
|
|
if [%1]==[] goto BuildEventFailed
|
|
|
|
set PROJ_NAME=%1
|
|
|
|
set PROJ_EXEC=%2
|
|
|
|
set BUILD_TYPE=%3
|
|
|
|
set PROJ_DIR=%4
|
|
|
|
|
|
|
|
REM *** Change these Folders if required ***
|
|
|
|
set NETGEN_TCLSRC=%PROJ_DIR%..\ng
|
2009-02-16 01:25:44 +05:00
|
|
|
set INSTALL_FOLDER=%PROJ_DIR%%BUILD_TYPE%-bin
|
2009-02-01 01:19:54 +05:00
|
|
|
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% ........
|
|
|
|
|
|
|
|
REM *** Embed the Windows Manifest into the Executable File ***
|
|
|
|
echo Embedding Manifest into the executable: %PROJ_EXEC% ....
|
|
|
|
mt.exe -manifest "%BUILD_TYPE%\%PROJ_EXEC%.intermediate.manifest" "-outputresource:%BUILD_TYPE%\%PROJ_EXEC%;1"
|
|
|
|
if errorlevel 1 goto BuildEventFailed
|
|
|
|
|
|
|
|
REM *** Copy the TCL files and the executable to the Install Folder ***
|
|
|
|
echo Installing required files into %INSTALL_FOLDER% ....
|
|
|
|
xcopy "%NETGEN_TCLSRC%\*.tcl" "%INSTALL_FOLDER%" /i /d /y
|
|
|
|
if errorlevel 1 goto BuildEventFailed
|
|
|
|
|
|
|
|
xcopy "%PROJ_DIR%%BUILD_TYPE%\%PROJ_EXEC%" "%INSTALL_FOLDER%" /i /d /y
|
|
|
|
if errorlevel 1 goto BuildEventFailed
|
|
|
|
|
2009-02-16 01:25:44 +05:00
|
|
|
REM *** Clean up the build directory by deleting the OBJ files ***
|
|
|
|
REM echo Deleting the %PROJ_NAME% build folder %PROJ_DIR%%PROJ_NAME% ....
|
|
|
|
REM rmdir %PROJ_DIR%%BUILD_TYPE% /s /q
|
|
|
|
|
2009-02-01 01:19:54 +05:00
|
|
|
REM *** If there have been no errors so far, we are done ***
|
|
|
|
goto BuildEventOK
|
|
|
|
:BuildEventFailed
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Install Manually !!!
|
|
|
|
exit 1
|
|
|
|
:BuildEventOK
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% completed OK.....!!
|