mkdir build_dir
cd build_dir

:: Configure step.
cmake -G "%CMAKE_GENERATOR%" ^
      -D CMAKE_BUILD_TYPE=Release ^
      -D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -D BUILD_SHARED_LIBS:BOOL=ON ^
      -D CMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
      %SRC_DIR%
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Test.
ctest -C Release
if errorlevel 1 exit 1

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

REM Headers. Must be a better way...
rem echo .cpp > excludelist.txt
rem mkdir %LIBRARY_INC%\xercesc
rem xcopy /s /exclude:excludelist.txt src\xercesc %LIBRARY_INC%\xercesc
rem if errorlevel 1 exit 1
