
@echo off
setlocal

set BASE_NAME_A=libQulPlatformBSP_eaimxrt1176-freertos_32bpp_Windows_armgcc_MinSizeRel.a
set BASE_NAME_B=libQulPlatform_eaimxrt1176-freertos_32bpp_Windows_armgcc_MinSizeRel.a
set BASE_NAME_C=libQulPlatformBSP_eaimxrt1176-freertos_32bpp_Windows_iar_MinSizeRel.a
set BASE_NAME_D=libQulPlatform_eaimxrt1176-freertos_32bpp_Windows_iar_MinSizeRel.a

goto :menu


:touch_file

:: https://superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch/764716
@copy /B %1+,, %1  > NUL
goto :EOF


:select_res

echo.
echo.
echo -----
echo Selected to use %1
echo -----
copy /Y %BASE_NAME_A%.%1 %BASE_NAME_A% > NUL
copy /Y %BASE_NAME_B%.%1 %BASE_NAME_B% > NUL
copy /Y %BASE_NAME_C%.%1 %BASE_NAME_C% > NUL
copy /Y %BASE_NAME_D%.%1 %BASE_NAME_D% > NUL

:: Touch the file just to trigger Qt
call :touch_file %BASE_NAME_A%
call :touch_file %BASE_NAME_B%
call :touch_file %BASE_NAME_C%
call :touch_file %BASE_NAME_D%
call :touch_file ..\platform\boards\embeddedartists\eaimxrt1176-freertos\cmake\BoardDefaults.cmake

goto :EOF

:done
pause
goto :EOF

:menu
echo.
echo Select which display/resolution to use
echo.
echo 0 - DEMO_PANEL_RK055AHD091
echo 1 - DEMO_PANEL_RK055IQH091
echo 2 - DEMO_PANEL_HDMI_720X480_60 with USB touch
echo 3 - DEMO_PANEL_HDMI_720X576_50 with USB touch
echo 4 - DEMO_PANEL_HDMI_800X480_60 with USB touch
echo 5 - DEMO_PANEL_HDMI_1024X768_60 with USB touch (default display)
echo 6 - DEMO_PANEL_HDMI_1280X720_60 with USB touch
echo.
echo q - quit
echo.
set M=-
set /P M=Type 0..6 or q then press ENTER:
if %M%==0 ( call :select_res DEMO_PANEL_RK055AHD091
          goto :done )
if %M%==1 ( call :select_res DEMO_PANEL_RK055IQH091
          goto :done )
if %M%==2 ( call :select_res DEMO_PANEL_HDMI_720X480_60
          goto :done )
if %M%==3 ( call :select_res DEMO_PANEL_HDMI_720X576_50
          goto :done )
if %M%==4 ( call :select_res DEMO_PANEL_HDMI_800X480_60
          goto :done )
if %M%==5 ( call :select_res DEMO_PANEL_HDMI_1024X768_60
          goto :done )
if %M%==6 ( call :select_res DEMO_PANEL_HDMI_1280X720_60
          goto :done )
if %M%==q goto :EOF
echo.
echo Unknown option selected %M%
echo.
goto :menu

