extend windows build script
-REM stage 1, library
+ECHO "stage 1, library"
+setlocal EnableDelayedExpansion
+
mkdir _build
cd _build
REM add future installation path to pkgconfig
-set PKG_CONFIG_PATH=%PREFIX%\lib\pkgconfig;
+set PKG_CONFIG_PATH=%LIBRARY_PREFIX%\pkgconfig;
+
+cmake -G"NMake Makefiles" ^
+ -DCMAKE_BUILD_TYPE=Release ^
+ -DODE_WITH_DEMOS:BOOL=OFF ^
+ -DODE_WITH_TESTS:BOOL=OFF ^
+ -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
+ -DCMAKE_PREFIX_PATH:PATH=%LIBRARY_PREFIX% ^
+ ..
+if errorlevel 1 exit 1
+
+nmake VERBOSE=1
+if errorlevel 1 exit 1
+
+nmake install
+if errorlevel 1 exit 1
-cmake -G"NMake Makefiles" -DODE_WITH_DEMOS:BOOL=OFF -DODE_WITH_TESTS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH="" ..
-nmake install DESTDIR=%PREFIX%
cd ..
-REM stage 2, bindings
-cd bindings
-cd python
+ECHO "stage 2, bindings"
+cd bindings\python
+
+ECHO "check pkgconfig output"
+pkg-config --cflags ode
+pkg-config --libs ode
+ECHO "PKG_CONFIG_PATH %PKG_CONFIG_PATH%"
+
python setup.py install
+if errorlevel 1 exit 1
REM --root %PREFIX% --prefix ""
