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.

82 lines
3.4 KiB

  1. @echo off
  2. REM
  3. REM Copyright 2005-2014 Intel Corporation. All Rights Reserved.
  4. REM
  5. REM This file is part of Threading Building Blocks.
  6. REM
  7. REM Threading Building Blocks is free software; you can redistribute it
  8. REM and/or modify it under the terms of the GNU General Public License
  9. REM version 2 as published by the Free Software Foundation.
  10. REM
  11. REM Threading Building Blocks is distributed in the hope that it will be
  12. REM useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  13. REM of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. REM GNU General Public License for more details.
  15. REM
  16. REM You should have received a copy of the GNU General Public License
  17. REM along with Threading Building Blocks; if not, write to the Free Software
  18. REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. REM
  20. REM As a special exception, you may use this file as part of a free software
  21. REM library without restriction. Specifically, if other files instantiate
  22. REM templates or use macros or inline functions from this file, or you compile
  23. REM this file and link it with other files to produce an executable, this
  24. REM file does not by itself cause the resulting executable to be covered by
  25. REM the GNU General Public License. This exception does not however
  26. REM invalidate any other reasons why the executable file might be covered by
  27. REM the GNU General Public License.
  28. REM
  29. :: Getting parameters
  30. if ("%1") == ("") goto error0
  31. if ("%2") == ("") goto error0
  32. if ("%3") == ("") goto error0
  33. set arch=%1
  34. if ("%2") == ("debug") set postfix=_debug
  35. set output_dir=%3
  36. :: Optional 4th parameter to set install root
  37. if ("%4") NEQ ("") set TBBROOT=%4
  38. :: Actually we can set install root by ourselves
  39. if ("%TBBROOT%") == ("") set TBBROOT=%~d0%~p0..\..\
  40. :: Getting vs folders in case vc_mt binaries are not provided
  41. :: ordered from oldest to newest, so we end with newest available version
  42. if ("%VS90COMNTOOLS%") NEQ ("") set vc_dir=vc9
  43. if ("%VS100COMNTOOLS%") NEQ ("") set vc_dir=vc10
  44. if ("%VS110COMNTOOLS%") NEQ ("") set vc_dir=vc11
  45. if ("%VS120COMNTOOLS%") NEQ ("") set vc_dir=vc12
  46. :: Are we standalone/oss or inside compiler?
  47. if exist "%TBBROOT%\bin\%arch%\%vc_dir%\tbb%postfix%.dll" set interim_path=bin\%arch%
  48. if exist "%TBBROOT%\..\redist\%arch%\tbb\%vc_dir%\tbb%postfix%.dll" set interim_path=..\redist\%arch%\tbb
  49. if ("%interim_path%") == ("") goto error1
  50. :: Do we provide vc_mt binaries?
  51. if exist "%TBBROOT%\%interim_path%\vc_mt\tbb%postfix%.dll" set vc_dir=vc_mt
  52. if ("%vc_dir%") == ("") goto error2
  53. :: We know everything we wanted and there are no errors
  54. :: Copying binaries
  55. copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb%postfix%.dll" "%output_dir%"
  56. copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb%postfix%.pdb" "%output_dir%"
  57. copy "%TBBROOT%\%interim_path%\%vc_dir%\tbbmalloc%postfix%.dll" "%output_dir%"
  58. copy "%TBBROOT%\%interim_path%\%vc_dir%\tbbmalloc%postfix%.pdb" "%output_dir%"
  59. if exist "%TBBROOT%\%interim_path%\%vc_dir%\tbb_preview%postfix%.dll" copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb_preview%postfix%.dll" "%output_dir%"
  60. if exist "%TBBROOT%\%interim_path%\%vc_dir%\tbb_preview%postfix%.pdb" copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb_preview%postfix%.pdb" "%output_dir%"
  61. goto end
  62. :error0
  63. echo number of parameters not correct
  64. exit /B 1
  65. :error1
  66. echo Could not determine path to TBB libraries
  67. exit /B 1
  68. :error2
  69. echo Could not determine Visual Studio version
  70. exit /B 1
  71. :end
  72. exit /B 0