springkim / WSpring

windows setup script
11 stars 1 forks source link

glog issue #7

Open changh95 opened 5 years ago

changh95 commented 5 years ago

:: :: install_glog.bat :: WSpring :: :: Created by kimbomm on 2018. 04. 26... :: Copyright 2017-2018 kimbomm. All rights reserved. :: @echo off

nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" if '%errorlevel%' NEQ '0' ( echo Get admin permission... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params = %*:"="" echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" rem del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0"

::start title install_glog echo Downloading... cd %TEMP% call :SafeRMDIR "build_glog" mkdir build_glog cd build_glog ::GOTO DOWNLOADSKIP git clone https://github.com/google/glog :DOWNLOADSKIP

set CCC=0 if exist "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" ( set CC[%CCC%]="Visual Studio 12 2013 Win64" set CMAKEDIR[%CCC%]="build_vc12" set CCDIR[%CCC%]="vc12" set dst_include_dir[%CCC%]="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\" set dst_lib_dir[%CCC%]="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64\" set src_lib_dir[%CCC%]=vc12 set extension[%CCC%]=lib set /a CCC=%CCC%+1 ) if exist "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" ( set CC[%CCC%]="Visual Studio 14 2015 Win64" set CMAKEDIR[%CCC%]="build_vc14" set CCDIR[%CCC%]="vc14" set dst_include_dir[%CCC%]="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\" set dst_lib_dir[%CCC%]="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\" set src_lib_dir[%CCC%]=vc14 set extension[%CCC%]=lib set /a CCC=%CCC%+1 ) if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe" ( cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\" dir /B > "%TEMP%\msvc2017path.txt" set /p "msvcnum="<"%TEMP%\msvc2017path.txt" cd "%TEMP%\build_glog" set CC[%CCC%]="Visual Studio 15 2017 Win64" set CMAKEDIR[%CCC%]="build_vc15" set CCDIR[%CCC%]="vc15" echo "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\%msvcnum%\include\" > "%TEMP%\msvc2017include.txt" set /p "dst_include_dir[%CCC%]="<"%TEMP%\msvc2017include.txt" echo "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\%msvcnum%\lib\x64\" > "%TEMP%\msvc2017lib.txt" set /p "dst_lib_dir[%CCC%]="<"%TEMP%\msvc2017lib.txt" set src_lib_dir[%CCC%]=vc15 set extension[%CCC%]=lib set /a CCC=%CCC%+1 ) if exist "C:\MinGW64\" ( set CC[%CCC%]="MinGW Makefiles" set CMAKEDIR[%CCC%]="build_mingw" set CCDIR[%CCC%]="" set dst_include_dir[%CCC%]="C:\MinGW64\x86_64-w64-mingw32\include\" set dst_lib_dir[%CCC%]="C:\MinGW64\x86_64-w64-mingw32\lib\" set src_lib_dir[%CCC%]=mingw set extension[%CCC%]=a set /a CCC=%CCC%+1 ) set /a CCC=%CCC%-1 ::CC = C Compiler ::CCC = C Compiler Count

setlocal EnableDelayedExpansion FOR /L %%i in (0,1,%CCC%) do ( if not exist !CMAKEDIR[%%i]! md !CMAKEDIR[%%i]! cd !CMAKEDIR[%%i]! cmake ..\glog -G !CC[%%i]! -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=build -DBUILD_SHARED_LIBS=ON if !CC[%%i]! == "MinGW Makefiles" ( cmake --build . --config Release cmake --build . --target install ) else ( cmake --build . --config Release --target ALL_BUILD cmake --build . --config Release --target INSTALL cmake --build . --config Debug --target ALL_BUILD cmake --build . --config Debug --target INSTALL call :AddPragmaComment "build\include\glog" ) xcopy /Y "build\include*." !dst_include_dir[%%i]! /e /h /k 2>&1 >NUL xcopy /Y "build\lib*glog" !dst_lib_dir[%%i]! 2>&1 >NUL if exist "build\bin\" ( xcopy /Y "build\bin*glog*" "C:\Windows\System32\" 2>&1 >NUL ) cd .. ) endlocal call :SafeRMDIR "build_glog" pause exit /b

:SafeRMDIR IF EXIST "%~1" ( RMDIR /S /Q "%~1" ) exit /b

::::::::::::::::::::::::::::::FUNCTION::::::::::::::::::::::::::::::안돌아감 :AddPragmaComment SETLOCAL EnableDelayedExpansion pushd %CD% cd %~1 FOR /R %%E IN (./.) DO ( set file=%%~nxE echo. >> !file! echo #ifdef _DEBUG >> !file! echo #pragma comment^(lib,"glogd.lib"^) >> !file! echo #else >> !file! echo #pragma comment^(lib,"glog.lib"^) >> !file! echo #endif >> !file! ) ENDLOCAL popd exit /b

springkim commented 1 year ago

https://www.markdownguide.org/hacks/

This text is red!

Make this text blue.

$C{i+j} = \sum{j=0}^{N}a{i}\cdot b{j}$

$\textcolor{green}{\text{마크다운}}$

$$\color{black}{Black}$$ $$\color{blue}{Blue}$$ $$\color{brown}{Brown}$$ $$\color{darkgray}{Darkgray}$$ $$\color{gray}{Gray}$$
$$\color{lightgray}{Lightgray}$$ $$\color{green}{Green}$$ $$\color{brown}{Brown}$$ $$\color{lime}{Lime}$$ $$\color{magenta}{Magenta}$$
$$\color{olive}{Olive}$$ $$\color{orange}{Orange}$$ $$\color{pink}{Pink}$$ $$\color{purple}{Purple}$$ $$\color{red}{Red}$$
$$\color{teal}{Teal}$$ $$\color{violet}{Violet}$$ $$\color{white}{White}$$ $$\color{yellow}{Yellow}$$ $$\color{BurntOrange}{MBurntOrange}$$
$$\color{white} \colorbox{Green} {White on Green} $$ $$\color{purple} \fcolorbox{red}{white} {Purple on White} $$ $$\color{black} \fcolorbox{white} {red} {Black on Red} $$ $$\color{black} \fcolorbox{red}{white} {Black on White} $$ $$\color{black} \colorbox{BurntOrange} {orange background} $$
$$\color{Magenta} \fcolorbox{red}{white} {Magenta on White} $$ $$\color{green} \fcolorbox{red}{white} {Green on White} $$ $$\color{lime} \fcolorbox{white}{red} {Lime on Red} $$ $$\color{Orange} \fcolorbox{white}{black} {Orange on Black} $$ $$\color{blue} \fcolorbox{white}{red} {Blue on White} $$

Note

:memo:

Warning :warning: :memo: :bulb:

$\color{#58A6FF}\textsf{\Large\ⓘ\kern{0.2cm}\normalsize Note}$

$\color{#D29922}\textsf{\Large\⚠\kern{0.2cm}\normalsize Warning}$

#111111

changh95 commented 1 year ago

ㅋㅋ 봄님 안녕하세요

springkim commented 1 year ago

ㅋㅋㅋㅋㅋㅋㅋ형기님 잘 지내시죠?