:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal
set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"

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

set "CATKIN_BUILD_BINARY_PACKAGE_ARGS=-DCATKIN_BUILD_BINARY_PACKAGE=1"
if "%PKG_NAME%" == "ros-noetic-catkin" (
    :: create catkin cookie to make it is a catkin workspace
    type NUL > %LIBRARY_PREFIX%\.catkin
    :: keep the workspace activation scripts (e.g., local_setup.bat)
    set CATKIN_BUILD_BINARY_PACKAGE_ARGS=
)

rd /s /q build
mkdir build
pushd build

set SKIP_TESTING=ON

cmake ^
    -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ^
    -DBUILD_SHARED_LIBS=ON ^
    -DPYTHON_EXECUTABLE=%PYTHON% ^
    -DPython3_EXECUTABLE=%PYTHON% ^
    -DSETUPTOOLS_DEB_LAYOUT=OFF ^
    -DBoost_USE_STATIC_LIBS=OFF ^
    %CATKIN_BUILD_BINARY_PACKAGE_ARGS% ^
    -DCATKIN_SKIP_TESTING=%SKIP_TESTING% ^
    %SRC_DIR%\%PKG_NAME%\src\work
if errorlevel 1 exit 1

if "%PKG_NAME%" == "ros-noetic-eigenpy" (
    cmake --build . --config Release --target all --parallel 1
    if errorlevel 1 exit 1
) else (
    cmake --build . --config Release --target all
    if errorlevel 1 exit 1
)

if "%SKIP_TESTING%" == "OFF" (
    cmake --build . --config Release --target run_tests
    if errorlevel 1 exit 1
)

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

if "%PKG_NAME%" == "ros-noetic-catkin" (
    :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
    :: This will allow them to be run on environment activation.
    for %%F in (activate deactivate) DO (
        if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
        copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
    )
)

if "%PKG_NAME%" == "ros-noetic-ros-workspace" (
    :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
    :: This will allow them to be run on environment activation.
    for %%F in (activate deactivate) DO (
        if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
        copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
    )
)
