-
Notifications
You must be signed in to change notification settings - Fork 23
/
build_chromaprint.bat
63 lines (54 loc) · 1.47 KB
/
build_chromaprint.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SETLOCAL
echo ---- Building chromaprint ----
set CHROMAPRINT_PATH=chromaprint-1.3.1
SET VALRETURN=0
if %MACHINE_X86% (
set PLATFORM=Win32
set COMPILERPROJECT="Visual Studio 14 2015"
) else (
set PLATFORM=x64
set COMPILERPROJECT="Visual Studio 14 2015 Win64"
)
if %CONFIG_RELEASE% (
set CONFIG=RelWithDebInfo
) else (
set CONFIG=Debug
)
REM Remove any existing files
erase %LIB_DIR%\*chromaprint*
cd build\%CHROMAPRINT_PATH%
REM Re-generate solution files.
rd /S /Q %PLATFORM%
mkdir %PLATFORM%
cd %PLATFORM%
REM TODO: verify that the cmake setting BUILD_SHARED_LIBS works correctly.
SET ADDITIONAL_SETTINGS=
IF NOT %STATIC_LIBS% (
SET ADDITIONAL_SETTINGS=-DBUILD_SHARED_LIBS=ON -DWITH_FFTW3_DYNAMIC=ON
)
"%CMAKEDIR%\cmake" ../ -G %COMPILERPROJECT% %ADDITIONAL_SETTINGS% -DWITH_FFTW3=ON -DFFTW3_DIR=../../..
IF ERRORLEVEL 1 (
SET VALRETURN=1
goto END
)
IF %STATIC_LIBS% (
set PROJECT=chromaprint_p
) else (
set PROJECT=chromaprint
)
%MSBUILD% chromaprint.sln /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% /t:Clean;%PROJECT%:Rebuild
IF ERRORLEVEL 1 (
SET VALRETURN=1
goto END
)
copy src\%CONFIG%\%PROJECT%.lib %LIB_DIR%
IF NOT %STATIC_LIBS% ( copy src\%CONFIG%\%PROJECT%.dll %LIB_DIR% )
copy src\%CONFIG%\%PROJECT%.pdb %LIB_DIR%
cd ..
copy src\chromaprint.h %INCLUDE_DIR%
:END
cd %ROOT_DIR%
REM the GOTO command resets the errorlevel and the endlocal resets the local environment,
REM so I have to use this workaround
ENDLOCAL & SET VALRETURN=%VALRETURN%
exit /b %VALRETURN%