VisLocalInfo.bat
资源名称:VisSDK.rar [点击查看]
上传用户:weixiumei
上传日期:2008-05-15
资源大小:1769k
文件大小:8k
源码类别:
人物传记/成功经验
开发平台:
Visual C++
- @echo off
- rem
- rem VisLocalInfo.bat
- rem
- rem Batch file to put local environment information into
- rem the VisLocalInfo.h header file.
- rem
- rem
- rem Check command line arguments. No arg or "%2"=="/a" means to do a clean
- rem build. A single argument means to only build VisLocalInfo.h if it does
- rem not already exist (or if this file was modified more recently).
- if "%1"=="" goto CleanBuild
- if "%2"=="/a" goto CleanBuild
- if not exist ..incVisLocalInfo.h goto CleanBuild
- rem
- rem Use the dir command with a file created in the current directory to
- rem determine whether this BAT file has been modified since it was last
- rem executed. If this BAT file has been modified, make a new
- rem ..incVisLocalInfo.h file.
- if not exist VisLocalInfo.snt goto CleanBuild
- if exist VisLocalInfoD.tmp attrib -r VisLocalInfoD.tmp
- if exist VisLocalInfoE.tmp attrib -r VisLocalInfoE.tmp
- rem /tw isn't available on Win95 / Win98, but the command will still work.
- dir /tw /o-d VisLocalInfo.bat VisLocalInfo.snt | find /I "VisLocalInfo." > VisLocalInfoD.tmp
- dir /tw /oe VisLocalInfo.bat VisLocalInfo.snt | find /I "VisLocalInfo." > VisLocalInfoE.tmp
- fc VisLocalInfoD.tmp VisLocalInfoE.tmp | find "no diff"
- if errorlevel 1 goto AlreadyExists
- :CleanBuild
- if exist ..incVisLocalInfo.h attrib -r ..incVisLocalInfo.h
- echo // VisLocalInfo.h > ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // Local machine information generated from environment variables. >> ..incVisLocalInfo.h
- rem
- echo // >> ..incVisLocalInfo.h
- echo // This file is generated when the VisLocalInfo project is built. >> ..incVisLocalInfo.h
- rem
- rem
- echo // >> ..incVisLocalInfo.h
- rem
- if "%OS%"=="Windows_NT" echo // >> ..incVisLocalInfo.h
- if "%OS%"=="Windows_NT" echo // Created on %date% at %time%. >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // Some features are not available in the external release >> ..incVisLocalInfo.h
- echo // of the Vision SDK. >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- rem
- rem (We can check for any file that should only be in the internal version.)
- if exist ..batMakeVisSDKRelease.bat goto InternalVersion
- rem external version does not include Luciform header files
- echo #define VIS_EXTERNAL_RELEASE 1 >> ..incVisLocalInfo.h
- echo #define VIS_NO_LUC_FILES 1 >> ..incVisLocalInfo.h
- goto DoneInternalVersionCheck
- :InternalVersion
- echo #define VIS_INTERNAL_RELEASE 1 >> ..incVisLocalInfo.h
- echo #define VIS_INCLUDE_SDSTREAM 1 >> ..incVisLocalInfo.h
- echo #define VIS_WRITE_32BIT_BMP_FILES_BY_DEFAULT 1 >> ..incVisLocalInfo.h
- rem
- rem
- echo // >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // The user name is used in DLL version information. The user and machine >> ..incVisLocalInfo.h
- echo // names can also be used to customize build settings. >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- rem
- rem %USERNAME% and %COMPUTERNAME% could contain '-'. We can only use them
- rem in macro names if they don't contain '-'.
- echo #define VIS_USER_NAME "%USERNAME%" >> ..incVisLocalInfo.h
- echo %USERNAME% | find "-"
- if errorlevel 1 echo #define VIS_USER_BUILD_%USERNAME% 1 >> ..incVisLocalInfo.h
- rem echo // >> ..incVisLocalInfo.h
- echo #define VIS_MACHINE_NAME "%COMPUTERNAME%" >> ..incVisLocalInfo.h
- echo %COMPUTERNAME% | find "-"
- if errorlevel 1 echo #define VIS_MACHINE_BUILD_%COMPUTERNAME% 1 >> ..incVisLocalInfo.h
- :DoneInternalVersionCheck
- rem
- rem
- echo // >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // The OS is used to determine which files are included in the project >> ..incVisLocalInfo.h
- echo // precompiled header files. >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- rem
- if "%OS%"=="Windows_NT" goto WinNT
- echo #define VIS_OS_IS_NT 0 >> ..incVisLocalInfo.h
- goto DoneOSCheck
- :WinNT
- echo #define VIS_OS_IS_NT 1 >> ..incVisLocalInfo.h
- :DoneOSCheck
- rem
- rem
- rem Check for Intel's IPL libraries.
- rem
- echo // >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // If Intel's Image Processing Library header files are found on your include >> ..incVisLocalInfo.h
- echo // files path, definitions will be added here. >> ..incVisLocalInfo.h
- rem Skip the call to findstr if we're not on NT.
- if not "%OS%"=="Windows_NT" goto NoIncIpl
- echo Searching include path for ipl.h:
- findstr /m /d:"%include%" /c:" Intel Corp" ipl.h
- if errorlevel 1 goto NoIncIpl
- echo #define VIS_IPL_IPL_H "ipl.h" >> ..incVisLocalInfo.h
- goto CkIplIjl
- rem
- :NoIncIpl
- if exist ..inciplipl.h echo #define VIS_IPL_IPL_H "iplipl.h" >> ..incVisLocalInfo.h
- rem
- :CkIplIjl
- rem Skip the call to findstr if we're not on NT.
- if not "%OS%"=="Windows_NT" goto NoIncIjl
- echo Searching include path for ijl.h:
- findstr /m /d:"%include%" /c:" Intel Corp" ijl.h
- if errorlevel 1 goto NoIncIjl
- echo #define VIS_IPL_IJL_H "ijl.h" >> ..incVisLocalInfo.h
- goto CkIplCblas
- rem
- :NoIncIjl
- if exist ..inciplijl.h echo #define VIS_IPL_IJL_H "iplijl.h" >> ..incVisLocalInfo.h
- rem
- :CkIplCblas
- rem Skip the call to findstr if we're not on NT.
- if not "%OS%"=="Windows_NT" goto NoIncCblas
- echo Searching include path for cblas.h:
- findstr /m /d:"%include%" "CblasRowMajor" cblas.h
- if errorlevel 1 goto NoIncCblas
- echo #define VIS_IPL_CBLAS_H "cblas.h" >> ..incVisLocalInfo.h
- goto DoneIpl
- rem
- :NoIncCblas
- if exist ..inciplcblas.h echo #define VIS_IPL_CBLAS_H "iplcblas.h" >> ..incVisLocalInfo.h
- :DoneIpl
- rem
- rem
- rem Check for optional Vision SDK projects
- rem
- echo // >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // Definitions for optional Vision SDK projects go here >> ..incVisLocalInfo.h
- if exist ..VisXCLAPACKVisXCLAPACK.h echo #define VIS_XCLAPACK_H "..VisXCLAPACKVisXCLAPACK.h" >> ..incVisLocalInfo.h
- if exist ..VisXCMINPACKVisXCMINPACK.h echo #define VIS_XCMINPACK_H "..VisXCMINPACKVisXCMINPACK.h" >> ..incVisLocalInfo.h
- if exist ..VisXIjlVisXIjl.h echo #define VIS_XIJL_H "..VisXIjlVisXIjl.h" >> ..incVisLocalInfo.h
- if exist ..VisXImageMagickVisXImageMagick.h echo #define VIS_XIMAGEMAGICK_H "..VisXImageMagickVisXImageMagick.h" >> ..incVisLocalInfo.h
- rem
- rem
- rem Allow user-defined changes to be made in a VisLocalSettings.bat file.
- rem
- if exist "VisLocalSettings.bat" call VisLocalSettings.bat
- rem
- rem
- echo // >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- echo // You can create a file named "VisUserSettings.h" in the inc directory >> ..incVisLocalInfo.h
- echo // to add definitions that will be included in the Vision SDK header files. >> ..incVisLocalInfo.h
- echo // >> ..incVisLocalInfo.h
- if exist ..incVisUserSettings.h goto HaveUserSettingsFile
- echo // #include "VisUserSettings.h" >> ..incVisLocalInfo.h
- goto DoneSettingsCheck
- :HaveUserSettingsFile
- echo #include "VisUserSettings.h" >> ..incVisLocalInfo.h
- :DoneSettingsCheck
- rem
- rem
- rem Call dir to set %errorlevel% to zero (to indicate that the batch file succeeded).
- dir /b ..incVisLocalInfo.h
- rem
- echo VisLocalInfo.h created.
- rem
- rem Create a temporary file in the current directory so that we can compare
- rem the date that this bat file was run to the date that this file was last
- rem modified using the dir command. (See the top of this file.)
- rem UNDONE: Does the following work okay on Win95 / Win98?
- rem (We only need some text for the file, we don't need %date% and %time%
- rem if they aren't available on Win95 / Win98.)
- rem
- if exist VisLocalInfo.snt attrib -r VisLocalInfo.snt
- echo VisLocalInfo.h was created on %date% at %time%. > VisLocalInfo.snt
- rem
- goto DoneAll
- rem
- rem
- :AlreadyExists
- rem
- rem
- rem Call dir to set %errorlevel% to zero (to indicate that the batch file succeeded).
- dir /b ..incVisLocalInfo.h
- rem
- echo VisLocalInfo.h already exists. File not modified.
- rem
- rem
- :DoneAll