From 474d156e61fffc998b53364129f9fff69e6a6a95 Mon Sep 17 00:00:00 2001 From: Philippose Rajan Date: Sat, 4 Apr 2009 21:54:20 +0000 Subject: [PATCH] * Changed netgen.lib -> nginterface.lib * Also pass name of "lib" file to post-build script * Added the remaining OCC files "*.ixx" and "*.jxx" to solution * New and improved postBuild_netgen.bat batch file - Lot more process feedback - More meaningful error messages - Also installs nginterface.lib and nginterface.h to "-bin" folder * Modified MSVC 2008 / 2005 solution files to add the above changes --- windows/netgen.vcproj | 108 +++++++++++++++++++++++++-------- windows/netgen_MSVC2005.vcproj | 80 +++++++++++++++++++++--- windows/postBuild_netgen.bat | 59 +++++++++++++++--- 3 files changed, 206 insertions(+), 41 deletions(-) diff --git a/windows/netgen.vcproj b/windows/netgen.vcproj index 68c0c092..329ff427 100644 --- a/windows/netgen.vcproj +++ b/windows/netgen.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(SolutionDir)..";"$(SolutionDir)..\ng";"$(SolutionDir)..\libsrc\include";"$(SolutionDir)..\libsrc\interface";"$(SolutionDir)..\..\ext_libs\tcl\include";"$(SolutionDir)..\..\ext_libs\pthread-w32\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG;MSVC_EXPRESS;OPENGL;WINVER=0x0501" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG;MSVC_EXPRESS;OPENGL;WINVER=0x0501;NGINTERFACE_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -62,6 +62,7 @@ /> @@ -94,7 +96,7 @@ @@ -180,7 +184,7 @@ @@ -266,7 +272,7 @@ @@ -347,7 +355,7 @@ @@ -416,11 +424,11 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/netgen_MSVC2005.vcproj b/windows/netgen_MSVC2005.vcproj index 5ce512cd..fdfbdcc4 100644 --- a/windows/netgen_MSVC2005.vcproj +++ b/windows/netgen_MSVC2005.vcproj @@ -41,7 +41,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(SolutionDir)..";"$(SolutionDir)..\ng";"$(SolutionDir)..\libsrc\include";"$(SolutionDir)..\libsrc\interface";"$(SolutionDir)..\..\ext_libs\tcl\include";"$(SolutionDir)..\..\ext_libs\pthread-w32\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG;MSVC_EXPRESS;OPENGL;WINVER=0x0501" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG;MSVC_EXPRESS;OPENGL;WINVER=0x0501;NGINTERFACE_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -61,13 +61,16 @@ /> @@ -95,7 +98,7 @@ @@ -183,7 +189,7 @@ @@ -272,7 +281,7 @@ @@ -355,7 +367,7 @@ @@ -1578,6 +1590,58 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/postBuild_netgen.bat b/windows/postBuild_netgen.bat index 58b0a0ec..ee3c2cc3 100644 --- a/windows/postBuild_netgen.bat +++ b/windows/postBuild_netgen.bat @@ -9,30 +9,55 @@ REM *** REM *** Call from Visual C++ using: REM *** postBuild_netgen.bat $(ProjectName) $(TargetFileName) $(ConfigurationName) $(ProjectDir) REM ********************************************************************************* -if [%1]==[] goto BuildEventFailed +if [%1]==[] goto InputParamsFailed set PROJ_NAME=%~1 set PROJ_EXEC=%~2 set BUILD_TYPE=%~3 set PROJ_DIR=%~4 +set LIB_NAME=%~5 REM *** Change these Folders if required *** -set NETGEN_TCLSRC=%PROJ_DIR%..\ng set INSTALL_FOLDER=%PROJ_DIR%%BUILD_TYPE%-bin +set NETGEN_TCLSRC=%PROJ_DIR%..\ng +set NETGEN_LIBINC=%PROJ_DIR%..\libsrc\include +REM *** Start the Installation procedure *** 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 +if errorlevel 1 goto ManifestFailed +echo Embedding Manifest into the executable: Completed OK!! -REM *** Copy the TCL files and the executable to the Install Folder *** -echo Installing required files into %INSTALL_FOLDER% .... +REM *** Copy the core TCL files into the Install Folder *** +echo Installing core TCL files into %INSTALL_FOLDER% .... xcopy "%NETGEN_TCLSRC%\*.tcl" "%INSTALL_FOLDER%" /i /d /y -if errorlevel 1 goto BuildEventFailed +if errorlevel 1 goto CoreTCLFailed +echo Installing core TCL Files: Completed OK!! +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 *** +echo Installing %PROJ_EXEC% into %INSTALL_FOLDER% .... xcopy "%PROJ_DIR%%BUILD_TYPE%\%PROJ_EXEC%" "%INSTALL_FOLDER%" /i /d /y -if errorlevel 1 goto BuildEventFailed +if errorlevel 1 goto ExecInstallFailed +echo Installing %PROJ_EXEC%: Completed OK!! + +REM *** Copy the primary Netgen library and include files into the Install Folder *** +echo Installing %LIB_NAME%.lib into %INSTALL_FOLDER% .... +xcopy "%PROJ_DIR%%BUILD_TYPE%\%LIB_NAME%.lib" "%INSTALL_FOLDER%" /i /d /y +if errorlevel 1 goto LibInstallFailed +echo Installing %LIB_NAME%.lib: Completed OK!! + +echo Installing %LIB_NAME%.h into %INSTALL_FOLDER% .... +xcopy "%NETGEN_LIBINC%\%LIB_NAME%.h" "%INSTALL_FOLDER%" /i /d /y +if errorlevel 1 goto LibInstallFailed +echo Installing %LIB_NAME%.h: Completed OK!! + +REM *** Done with the installation routine *** REM *** Clean up the build directory by deleting the OBJ files *** REM echo Deleting the %PROJ_NAME% build folder %PROJ_DIR%%PROJ_NAME% .... @@ -40,8 +65,24 @@ REM rmdir %PROJ_DIR%%BUILD_TYPE% /s /q REM *** If there have been no errors so far, we are done *** goto BuildEventOK -:BuildEventFailed -echo POSTBUILD Script for %PROJ_NAME% FAILED..... Install Manually !!! + +REM *** Error Messages for each stage of the post build process *** +:InputParamsFailed +echo POSTBUILD Script for %PROJ_NAME% FAILED..... Invalid number of input parameters!!! exit 1 +: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 +echo POSTBUILD Script for %PROJ_NAME% FAILED..... Error copying the netgen executable into install folder!!! +exit 1 +:LibInstallFailed +echo POSTBUILD Script for %PROJ_NAME% FAILED..... Error copying %LIB_NAME%.lib or %LIB_NAME%.h into install folder!!! +exit 1 + :BuildEventOK echo POSTBUILD Script for %PROJ_NAME% completed OK.....!! +