You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

windows-initialize-environment.cmd 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @echo off
  2. set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin;%PATH%
  3. set "SCRIPT_PATH=%~dp0"
  4. :parameter_parse
  5. if /i "%1" == "--dependencies-dir" (
  6. set "PATH_DEPENDENCIES=%2"
  7. SHIFT
  8. SHIFT
  9. Goto parameter_parse
  10. ) else if /i "%1" == "--platform-target" (
  11. if "%2"=="x64" (
  12. set PLATFORM=x64
  13. set VSPLATFORMGENERATOR=Win64
  14. ) else if "%2"=="x86" (
  15. set PLATFORM=x86
  16. set VSPLATFORMGENERATOR=
  17. ) else (
  18. echo Unknown platform %2 target
  19. Goto terminate
  20. )
  21. SHIFT
  22. SHIFT
  23. Goto parameter_parse
  24. ) else if not "%1" == "" (
  25. echo unrecognized option [%1]
  26. Goto terminate_error
  27. )
  28. if not defined PATH_DEPENDENCIES (
  29. if %PLATFORM%==x64 (
  30. SET "PATH_DEPENDENCIES=%SCRIPT_PATH%../dependencies_x64"
  31. ) else (
  32. SET "PATH_DEPENDENCIES=%SCRIPT_PATH%../dependencies"
  33. )
  34. )
  35. set PATH=%PATH_DEPENDENCIES%/boost/bin;%PATH%
  36. set PATH=%PATH_DEPENDENCIES%/cmake/bin;%PATH%
  37. set PATH=%PATH_DEPENDENCIES%/expat/bin;%PATH%
  38. set PATH=%PATH_DEPENDENCIES%/ninja;%PATH%
  39. set PATH=%PATH_DEPENDENCIES%/tvicport/bin;%PATH%
  40. set PATH=%PATH_DEPENDENCIES%/vcredist;%PATH%
  41. set PATH=%PATH_DEPENDENCIES%/zip;%PATH%
  42. set PATH=%PATH_DEPENDENCIES%/xerces-c/lib;%PATH%
  43. REM ########################################################################################################################
  44. REM # Set to 1 to skip new compilers.
  45. if not defined SKIP_VS2017 (
  46. SET SKIP_VS2017=1
  47. )
  48. if not defined SKIP_VS2015 (
  49. SET SKIP_VS2015=1
  50. )
  51. if not defined SKIP_VS2013 (
  52. SET SKIP_VS2013=0
  53. )
  54. SET VSTOOLS=
  55. SET VSCMake=
  56. set VCVARSALLPATH=../../VC/vcvarsall.bat
  57. if %SKIP_VS2017% == 0 (
  58. set "VSTOOLS=%VS150COMNTOOLS%"
  59. set VSCMake=Visual Studio 15 2017
  60. ) else if %SKIP_VS2015% == 0 (
  61. echo Visual Studio 2017 detection skipped as requested
  62. set "VSTOOLS=%VS140COMNTOOLS%"
  63. set VSCMake=Visual Studio 14 2015
  64. ) else (
  65. echo Visual Studio 2017 detection skipped as requested
  66. echo Visual Studio 2015 detection skipped as requested
  67. set "VSTOOLS=%VS120COMNTOOLS%"
  68. set VSCMake=Visual Studio 12 2013
  69. )
  70. echo VStools: %VSTOOLS%, VSCMake: %VSCMake%.
  71. if exist "!VSTOOLS!%VCVARSALLPATH%" (
  72. if %PlatformTarget% == x64 (
  73. if exist "!VSTOOLS!../../VC/bin/x64" (
  74. echo Found %VSCMake% tools: !VSTOOLS!%VCVARSALLPATH% %PlatformTarget%
  75. call "!VSTOOLS!%VCVARSALLPATH%" %PlatformTarget%
  76. ) else (
  77. echo Found %VSCMake% tools: !VSTOOLS!%VCVARSALLPATH% x86_amd64
  78. call "!VSTOOLS!%VCVARSALLPATH%" x86_amd64
  79. )
  80. ) else (
  81. echo Found %VSCMake% tools: !VSTOOLS!vsvars32.bat
  82. call "!VSTOOLS!vsvars32.bat"
  83. )
  84. goto terminate
  85. )
  86. set VSCMake=!VSCMake! %VSPLATFORMGENERATOR%
  87. goto terminate_success
  88. :terminate_error
  89. echo An error occured during environment initializing !
  90. pause
  91. exit 1
  92. REM #######################################################################################
  93. :terminate_success
  94. goto terminate
  95. REM #######################################################################################
  96. :terminate