Committing Intel(R) TBB 2018 source code
[platform/upstream/tbb.git] / examples / parallel_for / tachyon / msvs / win8ui / copy_libraries_and_assets.bat
1 @echo on
2 REM
3 REM Copyright (c) 2005-2017 Intel Corporation
4 REM
5 REM Licensed under the Apache License, Version 2.0 (the "License");
6 REM you may not use this file except in compliance with the License.
7 REM You may obtain a copy of the License at
8 REM
9 REM     http://www.apache.org/licenses/LICENSE-2.0
10 REM
11 REM Unless required by applicable law or agreed to in writing, software
12 REM distributed under the License is distributed on an "AS IS" BASIS,
13 REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 REM See the License for the specific language governing permissions and
15 REM limitations under the License.
16 REM
17 REM
18 REM
19 REM
20 REM
21 :: Getting parameters
22 :: Architecture
23 if ("%1") == ("") goto error0
24 :: Release/Debug
25 if ("%2") == ("") goto error0
26 :: Output directory
27 if (%3) == ("") goto error0
28 set arch=%1
29 if ("%2") == ("debug") set postfix=_debug
30 set output_dir="%3"
31 if ("%4") == ("") set dat_file="%output_dir%\..\..\dat\balls.dat"
32
33 :: Actually we can set install root by ourselves
34 if ("%TBBROOT%") == ("") set TBBROOT=%~dp0..\..\..\..\..\
35
36 :: ordered from oldest to newest, so we end with newest available version
37 if ("%VS110COMNTOOLS%") NEQ ("") set vc_dir=vc11_ui
38 if ("%VS120COMNTOOLS%") NEQ ("") set vc_dir=vc12_ui
39 echo Using %vc_dir% libraries
40
41 if exist "%TBBROOT%\bin\%arch%\%vc_dir%\tbb%postfix%.dll" set interim_path=bin\%arch%
42 if exist "%TBBROOT%..\redist\%arch%\tbb\%vc_dir%\tbb%postfix%.dll" set interim_path=..\redist\%arch%\tbb
43 if exist "%TBBROOT%\lib\%arch%\%vc_dir%\tbb%postfix%.lib" set interim_lib_path=lib\%arch%
44 if ("%interim_path%") == ("") goto error1
45 if ("%interim_lib_path%") == ("") goto error1
46
47 :: We know everything we wanted and there are no errors
48 :: Copying binaries
49
50 copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb%postfix%.dll" "%output_dir%"
51 copy "%TBBROOT%\%interim_path%\%vc_dir%\tbb%postfix%.pdb" "%output_dir%"
52 copy "%TBBROOT%\%interim_path%\%vc_dir%\tbbmalloc%postfix%.dll" "%output_dir%"
53 copy "%TBBROOT%\%interim_path%\%vc_dir%\tbbmalloc%postfix%.pdb" "%output_dir%"
54 copy "%TBBROOT%\%interim_lib_path%\%vc_dir%\tbb%postfix%.lib" "%output_dir%"
55
56 :: Copying DAT-file
57 echo Using DAT-file %dat_file% 
58 if exist %dat_file% copy %dat_file% "%output_dir%\Assets\balls.dat"
59
60 goto end
61 :error0
62 echo Custom build script usage: %0 [ia32 or intel64] [release or debug] [output dir] [dat-file]
63 exit /B 1
64 :error1
65 echo Could not determine path to Intel TBB libraries
66 exit /B 1
67
68 :end
69 exit /B 0