diff options
author | Christian Fetzer <fetzer.ch@gmail.com> | 2016-03-28 18:12:58 +0200 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@gmail.com> | 2016-04-03 09:26:26 +0200 |
commit | 99e532da7cb0a332b7761dd68c11e3c8ce9db1b5 (patch) | |
tree | 1752b54bb5f97272d95943e84aec27052495313b /project | |
parent | 0f1fa05a539bc5c55d09ed2f7262db091ede31bf (diff) |
[cmake] Add cmake parameter to BuildSetup.bat
First attempt to integrate cmake into the BuildSetup.bat script.
This is not perfect as the packaging only takes the main executable from
the cmake build and nothing more. Still good enough to verify on Jenkins.
Diffstat (limited to 'project')
-rw-r--r-- | project/Win32BuildSetup/BuildSetup.bat | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/project/Win32BuildSetup/BuildSetup.bat b/project/Win32BuildSetup/BuildSetup.bat index fea2d31a63..f2cb16392b 100644 --- a/project/Win32BuildSetup/BuildSetup.bat +++ b/project/Win32BuildSetup/BuildSetup.bat @@ -19,6 +19,7 @@ rem clean to force a full rebuild rem noclean to force a build without clean rem noprompt to avoid all prompts rem nomingwlibs to skip building all libs built with mingw +rem cmake to build with cmake instead of VS solution CLS COLOR 1B TITLE %APP_NAME% for Windows Build Script @@ -35,14 +36,16 @@ SET buildmingwlibs=true SET buildbinaryaddons=true SET exitcode=0 SET useshell=rxvt +SET cmake=0 SET BRANCH=na -FOR %%b in (%1, %2, %3, %4, %5) DO ( +FOR %%b in (%1, %2, %3, %4, %5, %6) DO ( IF %%b==clean SET buildmode=clean IF %%b==noclean SET buildmode=noclean IF %%b==noprompt SET promptlevel=noprompt IF %%b==nomingwlibs SET buildmingwlibs=false IF %%b==nobinaryaddons SET buildbinaryaddons=false IF %%b==sh SET useshell=sh + IF %%b==cmake SET cmake=1 ) SET buildconfig=Release @@ -118,6 +121,7 @@ set WORKSPACE=%CD%\..\.. goto DIE ) ) + IF %cmake%==1 goto COMPILE_CMAKE_EXE IF %buildmode%==clean goto COMPILE_EXE goto COMPILE_NO_CLEAN_EXE @@ -157,6 +161,40 @@ set WORKSPACE=%CD%\..\.. ECHO ------------------------------------------------------------ GOTO MAKE_BUILD_EXE + +:COMPILE_CMAKE_EXE + ECHO Wait while preparing the build. + ECHO ------------------------------------------------------------ + ECHO Compiling %APP_NAME% branch %BRANCH%... + + IF %buildmode%==clean ( + RMDIR /S /Q %WORKSPACE%\kodi-build + ) + MKDIR %WORKSPACE%\kodi-build + PUSHD %WORKSPACE%\kodi-build + + cmake.exe -G "Visual Studio 14" %WORKSPACE%\project\cmake + IF %errorlevel%==1 ( + set DIETEXT="%APP_NAME%.EXE failed to build!" + goto DIE + ) + + cmake.exe --build . --config "%buildconfig%" + IF %errorlevel%==1 ( + set DIETEXT="%APP_NAME%.EXE failed to build!" + goto DIE + ) + + set EXE="%WORKSPACE%\kodi-build\%buildconfig%\%APP_NAME%.exe" + set PDB="%WORKSPACE%\kodi-build\%buildconfig%\%APP_NAME%.pdb" + set D3D="%WORKSPACE%\kodi-build\D3DCompile*.DLL" + + POPD + ECHO Done! + ECHO ------------------------------------------------------------ + GOTO MAKE_BUILD_EXE + + :MAKE_BUILD_EXE ECHO Copying files... IF EXIST BUILD_WIN32 rmdir BUILD_WIN32 /S /Q |