Skip to content
Permalink
Browse files

update cmake's visual studio generator helper script

  • Loading branch information...
RadWolfie committed May 13, 2019
1 parent 56635ac commit 6d752b62659119004fa9200b7a162de7d9c96d67
Showing with 38 additions and 4 deletions.
  1. +38 −4 gen-wins-project.bat
@@ -5,8 +5,10 @@

SETLOCAL

:: Check if arg is none/help
IF "%1"=="" (
SET x86=1
SET cpu_arch=1
)
IF /I "%1"=="-h" (
GOTO :helpInfo
@@ -15,59 +17,91 @@ IF /I "%1"=="-help" (
GOTO :helpInfo
)

:: Check first arg (CPU cpu_architecture)
IF /I "%1"=="all" (
SET x86=1
SET x64=1
SET ARM=1
SET ARM64=1
SET cpu_arch=1
ECHO Generating all available projects...
)
IF /I "%1"=="x86" (
SET x86=1
SET cpu_arch=1
)
IF /I "%1"=="x64" (
SET x64=1
SET cpu_arch=1
)
IF /I "%1"=="ARM" (
SET ARM=1
SET cpu_arch=1
)
IF /I "%1"=="ARM64" (
SET ARM64=1
SET cpu_arch=1
)
IF NOT DEFINED cpu_arch (
GOTO :helpInfo
)

:: Check second arg (Visual Studio version)
IF "%2"=="2019" (
SET msvc_compiler=Visual Studio 16 2019
)
IF "%2"=="2017" (
SET msvc_compiler=Visual Studio 15 2017
)
IF "%2"=="" (
SET msvc_compiler=Visual Studio 15 2017
)
IF NOT DEFINED msvc_compiler (
GOTO :helpInfo
)

IF DEFINED x86 (
ECHO Generating x86 project...
mkdir build-x86 & pushd build-x86
cmake -G "Visual Studio 15 2017" -A Win32 ..
cmake .. -G "%msvc_compiler%" -A Win32
popd
)

IF DEFINED x64 (
ECHO Generating x64 project...
mkdir build-x64 & pushd build-x64
cmake -G "Visual Studio 15 2017" -A x64 ..
cmake .. -G "%msvc_compiler%" -A x64
popd
)

IF DEFINED ARM (
ECHO Generating ARM project...
mkdir build-arm & pushd build-arm
cmake -G "Visual Studio 15 2017" -A ARM ..
cmake .. -G "%msvc_compiler%" -A ARM
popd
)

IF DEFINED ARM64 (
ECHO Generating ARM64 project...
mkdir build-arm64 & pushd build-arm64
cmake -G "Visual Studio 15 2017" -A ARM64 ..
cmake .. -G "%msvc_compiler%" -A ARM64
popd
)

GOTO :end

:helpInfo
ECHO Available options are:
ECHO arg1
ECHO - all
ECHO - x86
ECHO - x64
ECHO - ARM
ECHO - ARM64
ECHO ---
ECHO arg2
ECHO - 2017
ECHO - 2019
PAUSE
GOTO :end

0 comments on commit 6d752b6

Please sign in to comment.
You can’t perform that action at this time.