vislocalinfo.bat
来自「microsoft vision source code」· Batch 代码 · 共 191 行
BAT
191 行
@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 ..\inc\VisLocalInfo.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 ..\inc\VisLocalInfo.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 ..\inc\VisLocalInfo.h attrib -r ..\inc\VisLocalInfo.h
echo // VisLocalInfo.h > ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // Local machine information generated from environment variables. >> ..\inc\VisLocalInfo.h
rem
echo // >> ..\inc\VisLocalInfo.h
echo // This file is generated when the VisLocalInfo project is built. >> ..\inc\VisLocalInfo.h
rem
rem
echo // >> ..\inc\VisLocalInfo.h
rem
if "%OS%"=="Windows_NT" echo // >> ..\inc\VisLocalInfo.h
if "%OS%"=="Windows_NT" echo // Created on %date% at %time%. >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // Some features are not available in the external release >> ..\inc\VisLocalInfo.h
echo // of the Vision SDK. >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
rem
rem (We can check for any file that should only be in the internal version.)
if exist ..\bat\MakeVisSDKRelease.bat goto InternalVersion
rem external version does not include Luciform header files
echo #define VIS_EXTERNAL_RELEASE 1 >> ..\inc\VisLocalInfo.h
echo #define VIS_NO_LUC_FILES 1 >> ..\inc\VisLocalInfo.h
goto DoneInternalVersionCheck
:InternalVersion
echo #define VIS_INTERNAL_RELEASE 1 >> ..\inc\VisLocalInfo.h
echo #define VIS_INCLUDE_SDSTREAM 1 >> ..\inc\VisLocalInfo.h
echo #define VIS_WRITE_32BIT_BMP_FILES_BY_DEFAULT 1 >> ..\inc\VisLocalInfo.h
rem
rem
echo // >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // The user name is used in DLL version information. The user and machine >> ..\inc\VisLocalInfo.h
echo // names can also be used to customize build settings. >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.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%" >> ..\inc\VisLocalInfo.h
echo %USERNAME% | find "-"
if errorlevel 1 echo #define VIS_USER_BUILD_%USERNAME% 1 >> ..\inc\VisLocalInfo.h
rem echo // >> ..\inc\VisLocalInfo.h
echo #define VIS_MACHINE_NAME "%COMPUTERNAME%" >> ..\inc\VisLocalInfo.h
echo %COMPUTERNAME% | find "-"
if errorlevel 1 echo #define VIS_MACHINE_BUILD_%COMPUTERNAME% 1 >> ..\inc\VisLocalInfo.h
:DoneInternalVersionCheck
rem
rem
echo // >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // The OS is used to determine which files are included in the project >> ..\inc\VisLocalInfo.h
echo // precompiled header files. >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
rem
if "%OS%"=="Windows_NT" goto WinNT
echo #define VIS_OS_IS_NT 0 >> ..\inc\VisLocalInfo.h
goto DoneOSCheck
:WinNT
echo #define VIS_OS_IS_NT 1 >> ..\inc\VisLocalInfo.h
:DoneOSCheck
rem
rem
rem Check for Intel's IPL libraries.
rem
echo // >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // If Intel's Image Processing Library header files are found on your include >> ..\inc\VisLocalInfo.h
echo // files path, definitions will be added here. >> ..\inc\VisLocalInfo.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" >> ..\inc\VisLocalInfo.h
goto CkIplIjl
rem
:NoIncIpl
if exist ..\inc\ipl\ipl.h echo #define VIS_IPL_IPL_H "ipl\ipl.h" >> ..\inc\VisLocalInfo.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" >> ..\inc\VisLocalInfo.h
goto CkIplCblas
rem
:NoIncIjl
if exist ..\inc\ipl\ijl.h echo #define VIS_IPL_IJL_H "ipl\ijl.h" >> ..\inc\VisLocalInfo.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" >> ..\inc\VisLocalInfo.h
goto DoneIpl
rem
:NoIncCblas
if exist ..\inc\ipl\cblas.h echo #define VIS_IPL_CBLAS_H "ipl\cblas.h" >> ..\inc\VisLocalInfo.h
:DoneIpl
rem
rem
rem Check for optional Vision SDK projects
rem
echo // >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // Definitions for optional Vision SDK projects go here >> ..\inc\VisLocalInfo.h
if exist ..\VisXCLAPACK\VisXCLAPACK.h echo #define VIS_XCLAPACK_H "..\VisXCLAPACK\VisXCLAPACK.h" >> ..\inc\VisLocalInfo.h
if exist ..\VisXCMINPACK\VisXCMINPACK.h echo #define VIS_XCMINPACK_H "..\VisXCMINPACK\VisXCMINPACK.h" >> ..\inc\VisLocalInfo.h
if exist ..\VisXIjl\VisXIjl.h echo #define VIS_XIJL_H "..\VisXIjl\VisXIjl.h" >> ..\inc\VisLocalInfo.h
if exist ..\VisXImageMagick\VisXImageMagick.h echo #define VIS_XIMAGEMAGICK_H "..\VisXImageMagick\VisXImageMagick.h" >> ..\inc\VisLocalInfo.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 // >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
echo // You can create a file named "VisUserSettings.h" in the inc directory >> ..\inc\VisLocalInfo.h
echo // to add definitions that will be included in the Vision SDK header files. >> ..\inc\VisLocalInfo.h
echo // >> ..\inc\VisLocalInfo.h
if exist ..\inc\VisUserSettings.h goto HaveUserSettingsFile
echo // #include "VisUserSettings.h" >> ..\inc\VisLocalInfo.h
goto DoneSettingsCheck
:HaveUserSettingsFile
echo #include "VisUserSettings.h" >> ..\inc\VisLocalInfo.h
:DoneSettingsCheck
rem
rem
rem Call dir to set %errorlevel% to zero (to indicate that the batch file succeeded).
dir /b ..\inc\VisLocalInfo.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 ..\inc\VisLocalInfo.h
rem
echo VisLocalInfo.h already exists. File not modified.
rem
rem
:DoneAll
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?