anchor.diff:  xcopy /q /y /R "%USERPROFILE%\cmake_ce8\common\Release\*.*" "%build-root%\build_output\c\wec2013\release\*.*"
   xcopy /q /y /R "%USERPROFILE%\cmake_ce8\serializer\Release\*.*" "%build-root%\build_output\c\wec2013\release\*.*"
   
  -rem Tests can't be executed on the local PC, must run on remote target
  -rem ctest -C "debug" -V
  -rem if not %errorlevel%==0 exit /b %errorlevel%
   
  -if %build-clean%==1 (
  -	
  -    call :clean-a-solution "%build-root%\iothub_client\samples\iothub_client_sample_http\windowsce\iothub_client_sample_http.sln"
  -    if not %errorlevel%==0 exit /b %errorlevel%
  -  
  -    call :clean-a-solution "%build-root%\serializer\samples\simplesample_http\windowsce\simplesample_http.sln"
  -    rem if not %errorlevel%==0 exit /b %errorlevel%
  -    	
  -	  call :clean-a-solution "%build-root%\serializer\samples\remote_monitoring\windowsce\remote_monitoring.sln"
  -    if not %errorlevel%==0 exit /b %errorlevel%
  -	
  -	  call :clean-a-solution "%build-root%\serializer\samples\temp_sensor_anomaly\windowsce\temp_sensor_anomaly.sln"
  -    if not %errorlevel%==0 exit /b %errorlevel%
  -
  -)
  -
  -
  -
  -rem -----------------------------------------------------------------------------
  -rem -- build solutions
  -rem -----------------------------------------------------------------------------
  -
  -
  -call :build-a-solution "%build-root%\iothub_client\samples\iothub_client_sample_http\windowsce\iothub_client_sample_http.sln"
  - if not %errorlevel%==0 exit /b %errorlevel%
  -
  -call :build-a-solution "%build-root%\serializer\samples\simplesample_http\windowsce\simplesample_http.sln"
  -if not %errorlevel%==0 exit /b %errorlevel%
  -
  -call :build-a-solution "%build-root%\serializer\samples\remote_monitoring\windowsce\remote_monitoring.sln"
  -if not %errorlevel%==0 exit /b %errorlevel%
  -
  -popd
  -goto :eof
  -
  -
  -rem -----------------------------------------------------------------------------
  -rem -- subroutines
  -rem -----------------------------------------------------------------------------
  -
  -:clean-a-solution
  -call :_run-msbuild "Clean" %1 %2 %3
  -goto :eof
  -
  -
  -:build-a-solution
  -call :_run-msbuild "Build" %1 %2 %3
  -goto :eof
  -
  -
  -:run-unit-tests
  -call :_run-tests %1 "UnitTests"
  -goto :eof
  -
  -
  -:run-e2e-tests
  -call :_run-tests %1 "e2eTests"
  -goto :eof
  -
  -:run-longhaul-tests
  -call :_run-tests %1 "longhaul"
  -goto :eof
  -
  -:usage
  -echo build.cmd [options]
  -echo options:
  -echo  -c, --clean           delete artifacts from previous build before building
  -echo  --config ^<value^>      [Debug] build configuration (e.g. Debug, Release)
  -echo  --platform ^<value^>    [Win32] build platform (e.g. Win32, x64, ...)
  -echo  --run-e2e-tests       run end-to-end tests
  -echo  --run-longhaul-tests  run long-haul tests
  -goto :eof
  -
  -
  -rem -----------------------------------------------------------------------------
  -rem -- helper subroutines
  -rem -----------------------------------------------------------------------------
  -
  -:_run-msbuild
  -rem // optionally override configuration|platform
  -setlocal EnableExtensions
  -set build-target=
  -if "%~1" neq "Build" set "build-target=/t:%~1"
  -if "%~3" neq "" set build-config=%~3
  -if "%~4" neq "" set build-platform=%~4
  -
  -msbuild /m %build-target% "/p:Configuration=%build-config%;Platform=%SDKNAME%" %2
  -if not %errorlevel%==0 exit /b %errorlevel%
  -goto :eof
  -
  -
  -:_run-tests
  -rem // discover tests
  -set test-dlls-list=
  -set test-dlls-path=%build-root%\%~1\build\windows\%SDKNAME%\%build-config%
  -for /f %%i in ('dir /b %test-dlls-path%\*%~2*.dll') do set test-dlls-list="%test-dlls-path%\%%i" !test-dlls-list!
  -
  -if "%test-dlls-list%" equ "" (
  -    echo No unit tests found in %test-dlls-path%
  -    exit /b 1
  -)
  -
  -rem // run tests
  -echo Test DLLs: %test-dlls-list%
  -echo.
  -vstest.console.exe %test-dlls-list%
  -
  -if not %errorlevel%==0 exit /b %errorlevel%
  -goto :eof
  
positive.code: 
  if not %errorlevel%==0 exit /b %errorlevel%
  
  rem Only build the HTTP Sample
  rem msbuild /m azure_iot_sdks.sln
  if not %errorlevel%==0 exit /b %errorlevel%
  
  rem -- Copy all libraries to the repo directory to be able to build solutions
  
negative.code: set CMAKE_run_e2e_tests=OFF
  set CMAKE_run_longhaul_tests=OFF
  
  rem -----------------------------------------------------------------------------
  rem -- build solution with CMake
  rem -----------------------------------------------------------------------------
  
  rmdir /s/q "%USERPROFILE%\cmake_ce8"
  