Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Vérifie si l'utilisateur a les droits administratifs
- net session >nul 2>&1
- if %errorLevel% == 0 (
- echo L'utilisateur est administrateur
- ) else (
- echo L'utilisateur n'est pas administrateur
- echo Redémarrage avec les droits administratifs...
- pause
- powershell Start-Process "%0" -Verb runAs
- exit /b
- )
- :: Affiche une boîte de dialogue pour sélectionner le dossier contenant CMakeLists.txt
- echo Sélectionnez le dossier contenant CMakeLists.txt :
- set "folder="
- for /f "delims=" %%i in ('powershell -noprofile -command "Add-Type -AssemblyName System.Windows.Forms; $dialog = New-Object System.Windows.Forms.FolderBrowserDialog; $dialog.ShowDialog() | Out-Null; $dialog.SelectedPath"') do set "folder=%%i"
- if not defined folder (
- echo Aucun dossier sélectionné.
- pause
- exit /b
- )
- :: Affiche un menu pour sélectionner l'option de compilation
- echo Sélectionnez l'option de compilation :
- echo 1. Visual Studio 17 2022
- echo 2. Visual Studio 16 2019
- echo 3. Visual Studio 15 2017
- echo 4. Visual Studio 14 2015
- echo 5. Visual Studio 12 2013
- echo 6. Visual Studio 11 2012
- echo 7. Visual Studio 9 2008
- set /p "option="
- if "%option%" == "1" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 17 2022"
- ) else if "%option%" == "2" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 16 2019"
- ) else if "%option%" == "3" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 15 2017"
- ) else if "%option%" == "4" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 14 2015"
- ) else if "%option%" == "5" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 12 2013"
- ) else if "%option%" == "6" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 11 2012"
- ) else if "%option%" == "7" (
- cd\ && cd %folder%
- cmake -G "Visual Studio 9 2008"
- ) else (
- echo Option non valide.
- pause
- exit /b
- )
- pause
- /*
- Generators
- * Visual Studio 17 2022 = Generates Visual Studio 2022 project files.
- Use -A option to specify architecture.
- Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
- Use -A option to specify architecture.
- Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
- Optional [arch] can be "Win64" or "ARM".
- Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
- Optional [arch] can be "Win64" or "ARM".
- Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
- Optional [arch] can be "Win64" or "ARM".
- Visual Studio 11 2012 [arch] = Deprecated. Generates Visual Studio 2012
- project files. Optional [arch] can be
- "Win64" or "ARM".
- Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
- Optional [arch] can be "Win64" or "IA64".
- Borland Makefiles = Generates Borland makefiles.
- NMake Makefiles = Generates NMake makefiles.
- NMake Makefiles JOM = Generates JOM makefiles.
- MSYS Makefiles = Generates MSYS makefiles.
- MinGW Makefiles = Generates a make file for use with
- mingw32-make.
- Green Hills MULTI = Generates Green Hills MULTI files
- (experimental, work-in-progress).
- Unix Makefiles = Generates standard UNIX makefiles.
- Ninja = Generates build.ninja files.
- Ninja Multi-Config = Generates build-<Config>.ninja files.
- Watcom WMake = Generates Watcom WMake makefiles.
- CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
- CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
- CodeBlocks - NMake Makefiles JOM
- = Generates CodeBlocks project files.
- CodeBlocks - Ninja = Generates CodeBlocks project files.
- CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
- CodeLite - MinGW Makefiles = Generates CodeLite project files.
- CodeLite - NMake Makefiles = Generates CodeLite project files.
- CodeLite - Ninja = Generates CodeLite project files.
- CodeLite - Unix Makefiles = Generates CodeLite project files.
- Eclipse CDT4 - NMake Makefiles
- = Generates Eclipse CDT 4.0 project files.
- Eclipse CDT4 - MinGW Makefiles
- = Generates Eclipse CDT 4.0 project files.
- Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
- Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
- Kate - MinGW Makefiles = Generates Kate project files.
- Kate - NMake Makefiles = Generates Kate project files.
- Kate - Ninja = Generates Kate project files.
- Kate - Unix Makefiles = Generates Kate project files.
- Sublime Text 2 - MinGW Makefiles
- = Generates Sublime Text 2 project files.
- Sublime Text 2 - NMake Makefiles
- = Generates Sublime Text 2 project files.
- Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
- Sublime Text 2 - Unix Makefiles
- = Generates Sublime Text 2 project files.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement