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:
|
2009-04-06 04:12:45 +06:00
|
|
|
REM *** postBuild_netgen.bat $(ProjectName) $(TargetFileName) $(ConfigurationName) $(ProjectDir) <lib filename>
|
2009-02-01 01:19:54 +05:00
|
|
|
REM *********************************************************************************
|
2009-04-05 03:54:20 +06:00
|
|
|
if [%1]==[] goto InputParamsFailed
|
2009-04-04 16:02:53 +06:00
|
|
|
set PROJ_NAME=%~1
|
|
|
|
set PROJ_EXEC=%~2
|
|
|
|
set BUILD_TYPE=%~3
|
|
|
|
set PROJ_DIR=%~4
|
2009-04-05 03:54:20 +06:00
|
|
|
set LIB_NAME=%~5
|
2009-02-01 01:19:54 +05:00
|
|
|
|
|
|
|
REM *** Change these Folders if required ***
|
2009-04-06 04:12:45 +06:00
|
|
|
REM Check if the environment variable NETGENDIR exists,
|
|
|
|
REM and use it as the installation folder
|
|
|
|
if defined NETGENDIR (
|
|
|
|
echo Environment variable NETGENDIR found: %NETGENDIR%
|
|
|
|
set INSTALL_FOLDER=%NETGENDIR%\..
|
|
|
|
) else (
|
|
|
|
echo Environment variable NETGENDIR not found.... using default location!!!
|
|
|
|
set INSTALL_FOLDER=%PROJ_DIR%..\..\%PROJ_NAME%-inst
|
|
|
|
)
|
|
|
|
|
2009-04-05 03:54:20 +06:00
|
|
|
set NETGEN_TCLSRC=%PROJ_DIR%..\ng
|
|
|
|
set NETGEN_LIBINC=%PROJ_DIR%..\libsrc\include
|
2009-02-01 01:19:54 +05:00
|
|
|
|
2009-04-05 03:54:20 +06:00
|
|
|
REM *** Start the Installation procedure ***
|
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"
|
2009-04-05 03:54:20 +06:00
|
|
|
if errorlevel 1 goto ManifestFailed
|
|
|
|
echo Embedding Manifest into the executable: Completed OK!!
|
2009-02-01 01:19:54 +05:00
|
|
|
|
2009-04-05 03:54:20 +06:00
|
|
|
REM *** Copy the core TCL files into the Install Folder ***
|
2009-04-06 04:12:45 +06:00
|
|
|
echo Installing core TCL files into %INSTALL_FOLDER%\bin ....
|
|
|
|
xcopy "%NETGEN_TCLSRC%\*.tcl" "%INSTALL_FOLDER%\bin\" /i /d /y
|
2009-04-05 03:54:20 +06:00
|
|
|
if errorlevel 1 goto CoreTCLFailed
|
|
|
|
echo Installing core TCL Files: Completed OK!!
|
2009-02-01 01:19:54 +05:00
|
|
|
|
2009-04-05 03:54:20 +06:00
|
|
|
REM *** Copy any more auxiliary TCL files into the Install Folder ***
|
|
|
|
REM if errorlevel 1 goto AuxTCLFailed
|
|
|
|
REM echo Installing auxiliary TCL Files: Completed OK!!
|
|
|
|
|
|
|
|
REM *** Copy the primary Netgen executable file into the Install Folder ***
|
2009-04-06 04:12:45 +06:00
|
|
|
echo Installing %PROJ_EXEC% into %INSTALL_FOLDER%\bin ....
|
|
|
|
xcopy "%PROJ_DIR%%BUILD_TYPE%\%PROJ_EXEC%" "%INSTALL_FOLDER%\bin\" /i /d /y
|
2009-04-05 03:54:20 +06:00
|
|
|
if errorlevel 1 goto ExecInstallFailed
|
|
|
|
echo Installing %PROJ_EXEC%: Completed OK!!
|
|
|
|
|
|
|
|
REM *** Copy the primary Netgen library and include files into the Install Folder ***
|
2009-04-06 04:12:45 +06:00
|
|
|
echo Installing %LIB_NAME%.lib into %INSTALL_FOLDER%\lib ....
|
|
|
|
xcopy "%PROJ_DIR%%BUILD_TYPE%\%LIB_NAME%.lib" "%INSTALL_FOLDER%\lib\" /i /d /y
|
2009-04-05 03:54:20 +06:00
|
|
|
if errorlevel 1 goto LibInstallFailed
|
|
|
|
echo Installing %LIB_NAME%.lib: Completed OK!!
|
|
|
|
|
2009-04-06 04:12:45 +06:00
|
|
|
echo Installing %LIB_NAME%.h into %INSTALL_FOLDER%\include ....
|
|
|
|
xcopy "%NETGEN_LIBINC%\%LIB_NAME%.h" "%INSTALL_FOLDER%\include\" /i /d /y
|
2009-04-05 03:54:20 +06:00
|
|
|
if errorlevel 1 goto LibInstallFailed
|
|
|
|
echo Installing %LIB_NAME%.h: Completed OK!!
|
|
|
|
|
|
|
|
REM *** Done with the installation routine ***
|
2009-02-01 01:19:54 +05:00
|
|
|
|
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
|
2009-04-05 03:54:20 +06:00
|
|
|
|
|
|
|
REM *** Error Messages for each stage of the post build process ***
|
|
|
|
:InputParamsFailed
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Invalid number of input parameters!!!
|
2009-02-01 01:19:54 +05:00
|
|
|
exit 1
|
2009-04-05 03:54:20 +06:00
|
|
|
:ManifestFailed
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Manifest not successfully embedded!!!
|
|
|
|
exit 1
|
|
|
|
:CoreTCLFailed
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Error copying core TCL Files into install folder!!!
|
|
|
|
exit 1
|
|
|
|
:ExecInstallFailed
|
2009-04-06 04:12:45 +06:00
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Error copying the %PROJ_NAME% executable into install folder!!!
|
2009-04-05 03:54:20 +06:00
|
|
|
exit 1
|
|
|
|
:LibInstallFailed
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% FAILED..... Error copying %LIB_NAME%.lib or %LIB_NAME%.h into install folder!!!
|
|
|
|
exit 1
|
|
|
|
|
2009-02-01 01:19:54 +05:00
|
|
|
:BuildEventOK
|
|
|
|
echo POSTBUILD Script for %PROJ_NAME% completed OK.....!!
|
2009-04-05 03:54:20 +06:00
|
|
|
|