:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
@echo off
setlocal enabledelayedexpansion

set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"

:: MSVC is preferred.
set CC=cl.exe
set CXX=cl.exe

rd /s /q build
mkdir build
pushd build

:: set "CMAKE_GENERATOR=Ninja"

:: try to fix long paths issues by using default generator
set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"

set PYTHON="%PREFIX%\python.exe"
set PYTHON=%PYTHON:\=/%
set SP_DIR="..\Lib\site-packages"
set SP_DIR=%SP_DIR:\=/%

cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
    -DPYTHON_EXECUTABLE=%PYTHON% ^
    -DPython_EXECUTABLE=%PYTHON% ^
    -DPython3_EXECUTABLE=%PYTHON% ^
    -DSETUPTOOLS_DEB_LAYOUT=OFF ^
    -DBUILD_SHARED_LIBS=ON ^
    -DBUILD_TESTING=OFF ^
    -DCMAKE_OBJECT_PATH_MAX=255 ^
    -DPYTHON_INSTALL_DIR=%SP_DIR% ^
    --compile-no-warning-as-error ^
    %SRC_DIR%\src
if errorlevel 1 exit 1

cmake --build . --config Release --target install -j8
if errorlevel 1 exit 1