diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..c8ab31c0d2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+# Dependency and build folders created by the build scripts
+deps*/
+build*/
+install*/
diff --git a/win/build-deps.cmd b/win/build-deps.cmd
new file mode 100644
index 0000000000..6478ab7067
--- /dev/null
+++ b/win/build-deps.cmd
@@ -0,0 +1,404 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: ::
+:: This file is part of IfcOpenShell. ::
+:: ::
+:: IfcOpenShell is free software: you can redistribute it and/or modify ::
+:: it under the terms of the Lesser GNU General Public License as published by ::
+:: the Free Software Foundation, either version 3.0 of the License, or ::
+:: (at your option) any later version. ::
+:: ::
+:: IfcOpenShell is distributed in the hope that it will be useful, ::
+:: but WITHOUT ANY WARRANTY; without even the implied warranty of ::
+:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ::
+:: Lesser GNU General Public License for more details. ::
+:: ::
+:: You should have received a copy of the Lesser GNU General Public License ::
+:: along with this program. If not, see . ::
+:: ::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:: This batch file expects CMake generator as %1 and build configuration type as %2. If not provided,
+:: the GENERATOR_DEFAULT will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd)
+:: Optionally a build type (Build/Rebuild/Clean) can be passed as %3.
+
+@echo off
+echo.
+
+:: Enable the delayed environment variable expansion needed in vs-cfg.cmd.
+setlocal EnableDelayedExpansion
+
+:: Make sure vcvarsall.bat is called and dev env set is up.
+IF "%VSINSTALLDIR%"=="" (
+ utils\cecho {0C}Visual Studio environment variables not set - cannot proceed!{# #}{\n}
+ GOTO :Error
+)
+
+set PROJECT_NAME=IfcOpenShell
+
+utils\cecho {F0}This script fetches and builds all %PROJECT_NAME% dependencies{# #}{\n}
+echo.
+
+:: Set up variables depending on the used Visual Studio version
+call vs-cfg.cmd %1 %2
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+
+set BUILD_TYPE=%3
+
+IF %GENERATOR%=="" (
+ cecho {0C}GENERATOR not specified - cannot proceed!{# #}{\n}
+ GOTO :Error
+)
+
+IF "%BUILD_TYPE%"=="" set BUILD_TYPE=Build
+
+IF NOT "!BUILD_TYPE!"=="Build" IF NOT "!BUILD_TYPE!"=="Rebuild" IF NOT "!BUILD_TYPE!"=="Clean" (
+ utils\cecho {0C}Invalid build type passed: !BUILD_TYPE!. Cannot proceed, aborting!{# #}{\n}
+ GOTO :Error
+)
+
+:: Make sure deps and install folders exists.
+IF NOT EXIST %DEPS_DIR%. mkdir %DEPS_DIR%
+IF NOT EXIST %INSTALL_DIR%. mkdir %INSTALL_DIR%
+
+:: If we use VS2008, framework path (for MSBuild) may not be correctly set. Manually attempt to add in that case
+IF %VS_VER%==2008 set PATH=C:\Windows\Microsoft.NET\Framework\v3.5;%PATH%
+
+:: User-configurable build options
+IF "%IFCOS_INSTALL_PYTHON%"=="" set IFCOS_INSTALL_PYTHON=TRUE
+IF "%IFCOS_NUM_BUILD_PROCESSES%"=="" set IFCOS_NUM_BUILD_PROCESSES=%NUMBER_OF_PROCESSORS%
+
+:: For subroutines
+set MSBUILD_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCESSES% /t:%BUILD_TYPE%
+REM /clp:ErrorsOnly;WarningsOnly
+:: Note BUILD_TYPE not passed, Clean e.g. wouldn't delete the installed files.
+set INSTALL_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCESSES%
+set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
+
+REM echo.
+REM cecho {F0}This script fetches and builds all %PROJECT_NAME% dependencies{# #}{\n}
+
+:: Print build configuration information
+echo.
+cecho {0A}Script configuration:{# #}{\n}
+cecho {0D} CMake Generator = %GENERATOR%{# #}{\n}
+echo - Passed to CMake -G option.
+cecho {0D} Target Architecture = %TARGET_ARCH%{# #}{\n}
+echo - Whether were doing 32-bit (x86) or 64-bit (x64) build.
+cecho {0D} Dependency Directory = %DEPS_DIR%{# #}{\n}
+echo - The directory where %PROJECT_NAME% dependencies are fetched and built.
+cecho {0D} Installation Directory = %INSTALL_DIR%{# #}{\n}
+echo - The directory where %PROJECT_NAME% dependencies are installed.
+cecho {0D} Build Config Type = %BUILD_CFG%{# #}{\n}
+echo - The used build configuration type for the dependencies.
+echo Defaults to RelWithDebInfo if not specified.
+IF %BUILD_CFG%==MinSizeRel cecho {0E} WARNING: MinSizeRel build can suffer from a significant performance loss.{# #}{\n}
+cecho {0D} Build Type = %BUILD_TYPE%{# #}{\n}
+echo - The used build type for the dependencies (Build, Rebuild, Clean).
+echo Defaults to Build if not specified.
+cecho {0D} IFCOS_INSTALL_PYTHON = %IFCOS_INSTALL_PYTHON%{# #}{\n}
+echo - Download and install Python.
+echo Set to something other than TRUE if you wish to use an already installed version of Python.
+cecho {0D} IFCOS_NUM_BUILD_PROCESSES = %IFCOS_NUM_BUILD_PROCESSES%{# #}{\n}
+echo - How many MSBuild.exe processes may be run in parallel.
+echo Defaults to NUMBER_OF_PROCESSORS.
+echo.
+
+:: Print script's usage information
+cecho {0A}Requirements for a successful execution:{# #}{\n}
+echo 1. Install Git and make sure 'git' is accessible from PATH.
+echo - http://code.google.com/p/tortoisegit/
+echo 2. Install CMake and make sure 'cmake' is accessible from PATH.
+echo - http://www.cmake.org/
+echo 3. Visual Studio 2008 or newer (2013 or newer recommended).
+echo 4. Run this batch script with Visual Studio environment variables set.
+echo.
+REM TODO 3ds Max SDK?
+
+echo If you are not ready with the above, press Ctrl-C to abort!
+pause
+echo.
+
+cd %DEPS_DIR%
+goto :Python
+:Boost
+set BOOST_VERSION=1.59.0
+:: DEPENDENCY_NAME is used for logging and DEPENDENCY_DIR for saving from some redundant typing
+set DEPENDENCY_NAME=Boost %BOOST_VERSION%
+set DEPENDENCY_DIR="%DEPS_DIR%\boost"
+:: Version string with underscores instead of dots.
+set BOOST_VER=%BOOST_VERSION:.=_%
+set BOOST_ROOT=%DEPS_DIR%\boost
+REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost
+set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\%VS_PLATFORM%\lib
+:: NOTE Also zip download exists, if encountering problems with 7z for some reason.
+set ZIP_EXT=7z
+set BOOST_ZIP=boost_%BOOST_VER%.%ZIP_EXT%
+
+call :DownloadFile http://downloads.sourceforge.net/project/boost/boost/%BOOST_VERSION%/%BOOST_ZIP% "%DEPS_DIR%" %BOOST_ZIP%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :ExtractArchive %BOOST_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\boost"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+
+:: Build Boost build script
+IF EXIST "%DEPS_DIR%\boost_%BOOST_VER%". (
+ cd "%DEPS_DIR%"
+ ren boost_%BOOST_VER% boost
+ IF NOT EXIST "%DEPS_DIR%\boost\boost.css" GOTO :Error
+ cd "%DEPS_DIR%\boost"
+ cecho {0D}Building Boost build script.{# #}{\n}
+ call bootstrap vc%VC_VER%
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+)
+
+set BOOST_LIBS=--with-system --with-regex --with-thread --with-program_options --with-date_time
+:: NOTE Boost is fast to build with limited set of libraries so build it always.
+cd "%DEPS_DIR%\boost"
+cecho {0D}Building %DEPENDENCY_NAME% %BOOST_LIBS% Please be patient, this will take a while.{# #}{\n}
+IF EXIST "%DEPS_DIR%\boost\bin.v2\project-cache.jam" del "%DEPS_DIR%\boost\bin.v2\project-cache.jam"
+call .\b2 toolset=msvc-%VC_VER%.0 runtime-link=static address-model=%ARCH_BITS% -j%IFCOS_NUM_BUILD_PROCESSES% ^
+ %BOOST_LIBS% stage --stagedir=stage/vs%VS_VER%-%VS_PLATFORM%
+
+:ICU
+set DEPENDENCY_NAME=ICU
+set DEPENDENCY_DIR=N/A
+set ICU_ZIP=icu-55.1-vs%VS_VER%.7z
+cd "%DEPS_DIR%"
+call :DownloadFile http://www.npcglib.org/~stathis/downloads/%ICU_ZIP% "%DEPS_DIR%" %ICU_ZIP%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :ExtractArchive %ICU_ZIP% "%DEPS_DIR%" "%INSTALL_DIR%\icu"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+:: Rename lib and bin directories to predictable form
+IF EXIST "%DEPS_DIR%\icu-55.1-vs%VS_VER%". (
+ pushd "%DEPS_DIR%\icu-55.1-vs%VS_VER%"
+ IF EXIST bin. ren bin bin%ARCH_BITS%"
+ IF EXIST lib. ren lib lib%ARCH_BITS%"
+ popd
+)
+
+IF EXIST "%DEPS_DIR%\icu-55.1-vs%VS_VER%\". (
+ robocopy "%DEPS_DIR%\icu-55.1-vs%VS_VER%\include" "%INSTALL_DIR%\icu\include" /E /IS /njh /njs
+ IF NOT EXIST "%INSTALL_DIR%\icu\lib". mkdir "%INSTALL_DIR%\icu\lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicutest%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutest.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicutu%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutu.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuuc%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuuc.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicudt%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icudt.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuin%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuin.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuio%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuio.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicule%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icule.lib"
+ copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\siculx%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\iculx.lib"
+)
+
+:OpenCOLLADA
+:: Note OpenCOLLADA has only Release and Debug builds.
+set DEPENDENCY_NAME=OpenCOLLADA
+set DEPENDENCY_DIR=%DEPS_DIR%\OpenCOLLADA
+:: TODO Temporarily use our own repo until the upstream has static VC runtime option
+call :GitCloneOrPullRepository https://github.com/Tridify/OpenCOLLADA.git "%DEPENDENCY_DIR%"
+REM call :GitCloneOrPullRepository https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+IF NOT EXIST "%DEPENDENCY_DIR%\%BUILD_DIR%". (
+ cd "%DEPENDENCY_DIR%"
+ call git branch vs-static-rt origin/vs-static-rt
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+ call git checkout vs-static-rt
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+)
+cd "%DEPENDENCY_DIR%"
+:: NOTE OpenCOLLADA has been observed to have problems with switching between debug and release builds so
+:: uncomment to following line in order to delete the CMakeCache.txt always if experiencing problems.
+REM IF EXIST "%DEPENDENCY_DIR%\%BUILD_DIR%\CMakeCache.txt". del "%DEPENDENCY_DIR%\%BUILD_DIR%\CMakeCache.txt"
+call :RunCMake -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%\OpenCOLLADA" -DUSE_STATIC_MSVC_RUNTIME=1
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+REM TODO OpenCOLLADA takes a long time to build; build only if needed
+REM IF NOT EXIST "%DEPS_DIR%\OpenCOLLADA\%BUILD_DIR%\lib\%DEBUG_OR_RELEASE%\OpenCOLLADASaxFrameworkLoader.lib".
+call :BuildSolution "%DEPENDENCY_DIR%\%BUILD_DIR%\OPENCOLLADA.sln" %DEBUG_OR_RELEASE%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %DEBUG_OR_RELEASE%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+
+:oce-win-bundle
+set DEPENDENCY_NAME=oce-win-bundle
+set DEPENDENCY_DIR=%DEPS_DIR%\oce-win-bundle
+:: TODO Temporarily use our own repo until the upstream is fixed
+REM call :GitCloneOrPullRepository https://github.com/QbProg/oce-win-bundle.git "%DEPENDENCY_DIR%"
+call :GitCloneOrPullRepository https://github.com/Tridify/oce-win-bundle.git "%DEPENDENCY_DIR%"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+IF NOT EXIST "%DEPENDENCY_DIR%\%BUILD_DIR%". (
+ cd "%DEPENDENCY_DIR%"
+ call git branch msvc-enhancements origin/msvc-enhancements
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+ call git checkout msvc-enhancements
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+)
+cd "%DEPENDENCY_DIR%"
+call :RunCMake -DOCE_WIN_BUNDLE_INSTALL_DIR="%INSTALL_DIR%\oce-win-bundle" -DBUNDLE_USE_STATIC_MSVC_RUNTIME=1
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+REM IF NOT EXIST "%DEPENDENCY_DIR%\%BUILD_DIR%\FreeImage.cmake\%BUILD_CFG%\FreeImage.dll"
+call :BuildSolution "%DEPENDENCY_DIR%\%BUILD_DIR%\oce-win-bundle.sln" %BUILD_CFG%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+
+:OCE
+set DEPENDENCY_NAME=Open CASCADE Community Edition
+set DEPENDENCY_DIR=%DEPS_DIR%\oce
+:: TODO Temporarily use our own repo until the upstream has static VC runtime option
+REM call :GitCloneOrPullRepository https://github.com/tpaviot/oce.git "%DEPENDENCY_DIR%"
+call :GitCloneOrPullRepository https://github.com/Tridify/oce.git "%DEPENDENCY_DIR%"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+IF NOT EXIST "%DEPENDENCY_DIR%\%BUILD_DIR%". (
+ cd "%DEPENDENCY_DIR%"
+ call git branch temp-vs-static-lib-build-fixes origin/temp-vs-static-lib-build-fixes
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+ call git checkout temp-vs-static-lib-build-fixes
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+)
+cd "%DEPENDENCY_DIR%"
+set OCE_BUNDLE_ROOT_PATH="%INSTALL_DIR%\oce-win-bundle"
+REM -DOCE_USE_BUNDLE_SOURCE=1 REM set OCE_BUNDLE_ROOT_PATH=%DEPS_DIR%\oce-win-bundle
+:: NOTE Specify OCE_NO_LIBRARY_VERSION as rc.exe can fail due to long filenames and huge command-line parameter
+:: input (more than 32,000 characters). Could maybe try using subst for the build dir to overcome this.
+call :RunCMake -DOCE_BUILD_SHARED_LIB=0 -DOCE_USE_BUNDLE=1 -DOCE_BUNDLE_ROOT_PATH="%OCE_BUNDLE_ROOT_PATH%" ^
+ -DOCE_INSTALL_PREFIX="%INSTALL_DIR%\oce" -DOCE_TESTING=0 -DOCE_NO_LIBRARY_VERSION=1 ^
+ -DOCE_USE_STATIC_MSVC_RUNTIME=1
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+REM TODO OCE takes a long time to build; build only if needed
+call :BuildSolution "%DEPENDENCY_DIR%\%BUILD_DIR%\OCE.sln" %BUILD_CFG%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+
+:Python
+IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
+ set PYTHON_AMD64_POSTFIX=.amd64
+ IF NOT %TARGET_ARCH%==x64 set PYTHON_AMD64_POSTFIX=
+ :: TODO Update to 3.5 when it's released as it will have an option to install debug libraries.
+ set PYTHON_VERSION=3.4.3
+ set DEPENDENCY_NAME=Python %PYTHON_VERSION%
+ set DEPENDENCY_DIR=N/A
+ set PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.msi
+ cd "%DEPS_DIR%"
+ call :DownloadFile https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER% "%DEPS_DIR%" %PYTHON_INSTALLER%
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+ :: TODO Uninstall if build type == Clean
+ IF NOT EXIST "%INSTALL_DIR%\Python". (
+ cecho {0D}Installing %DEPENDENCY_NAME%. Please be patient, this will take a while.{# #}{\n}
+ msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR=%INSTALL_DIR%\Python
+ echo %ERRORLEVEL%
+ ) ELSE (
+ cecho {0D}%DEPENDENCY_NAME% already installed. Skipping.{# #}{\n}
+ )
+) ELSE (
+ cecho {0D}IFCOS_INSTALL_PYTHON not true, skipping installation of Python.{# #}{\n}
+)
+pause
+:SWIG
+set SWIG_VERSION=3.0.5
+set DEPENDENCY_NAME=SWIG %SWIG_VERSION%
+set DEPENDENCY_DIR=N/A
+set SWIG_ZIP=swigwin-%SWIG_VERSION%.zip
+cd "%DEPS_DIR%"
+call :DownloadFile http://sourceforge.net/projects/swig/files/swigwin/swigwin-%SWIG_VERSION%/%SWIG_ZIP% "%DEPS_DIR%" %SWIG_ZIP%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+call :ExtractArchive %SWIG_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\swigwin"
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+IF EXIST "%DEPS_DIR%\swigwin-%SWIG_VERSION%". (
+ pushd %DEPS%
+ ren swigwin-%SWIG_VERSION% swigwin
+ popd
+)
+IF EXIST "%DEPS_DIR%\swigwin\". robocopy "%DEPS_DIR%\swigwin" "%INSTALL_DIR%\swigwin" /E /IS /MOVE /njh /njs
+
+:Successful
+echo.
+%TOOLS%\utils\cecho {0A}%PROJECT_NAME% dependencies built.{# #}{\n}
+goto :Finish
+
+:Error
+echo.
+%TOOLS%\utils\cecho {0C}An error occurred! Aborting!{# #}{\n}
+goto :Finish
+
+:Finish
+set PATH=%ORIGINAL_PATH%
+cd %TOOLS%
+endlocal
+goto :EOF
+
+::::::::::::::::::::::::::::::::::::: Subroutines :::::::::::::::::::::::::::::::::::::
+
+:: DownloadFile - Downloads a file using wget
+:: Params: %1 url, %2 destinationDir, %3 filename
+:DownloadFile
+pushd %2
+IF NOT EXIST "%3". (
+ cecho {0D}Downloading %DEPENDENCY_NAME% into %2.{# #}{\n}
+ wget --no-check-certificate %1
+) ELSE (
+ cecho {0D}%DEPENDENCY_NAME% already downloaded. Skipping.{# #}{\n}
+)
+set RET=%ERRORLEVEL%
+popd
+exit /b %RET%
+
+:: ExtractArchive - Extracts an archive file using 7-zip
+:: Params: %1 filename, %2 destinationDir, %3 dirAfterExtraction
+:ExtractArchive
+IF NOT EXIST "%3". (
+ cecho {0D}Extracting %DEPENDENCY_NAME% into %2.{# #}{\n}
+ 7za x %1 -y -o%2
+) ELSE (
+ cecho {0D}%DEPENDENCY_NAME% already extracted into %3. Skipping.{# #}{\n}
+)
+exit /b %ERRORLEVEL%
+
+:: GitCloneOrPullRepository - Clones or pulls (if repository already cloned) a Git repository
+:: Params: %1 gitUrl, %2 destDir
+:: F.ex. call :GitCloneRepository https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPS_DIR%\OpenCOLLADA\"
+:GitCloneOrPullRepository
+IF NOT EXIST %2. (
+ cecho {0D}Cloning %DEPENDENCY_NAME% into %2.{# #}{\n}
+ pushd "%DEPS_DIR%"
+ call git clone %1 %2
+) ELSE (
+ cecho {0D}%DEPENDENCY_NAME% already cloned. Pulling latest changes.{# #}{\n}
+ pushd %2
+ call git pull
+)
+set RET=%ERRORLEVEL%
+popd
+exit /b %RET%
+
+:: RunCMake - Runs CMake for a CMake-based project
+:: Params: %* cmakeOptions
+:: NOTE cd to root CMakeLists.txt folder before calling this if the CMakeLists.txt is not in the repo root.
+:RunCMake
+cecho {0D}Running CMake for %DEPENDENCY_NAME%.{# #}{\n}
+IF NOT EXIST %BUILD_DIR%. mkdir %BUILD_DIR%
+IF NOT %ERRORLEVEL%==0 GOTO :Error
+pushd %BUILD_DIR%
+:: TODO make deleting cache a parameter for this subroutine? We probably want to delete the
+:: cache always e.g. when we've had new changes in the repository.
+IF %BUILD_TYPE%==Rebuild IF EXIST CMakeCache.txt. del CMakeCache.txt
+cmake .. -G %GENERATOR% %*
+set RET=%ERRORLEVEL%
+popd
+exit /b %RET%
+
+:: BuildSolution - Builds/Rebuilds/Cleans a solution using MSBuild
+:: Params: %1 solutioName, %2 configuration
+:BuildSolution
+cecho {0D}%BUILD_TYPE%ing %2 %DEPENDENCY_NAME%. Please be patient, this will take a while.{# #}{\n}
+%MSBUILD_CMD% %1 /p:configuration=%2;platform=%VS_PLATFORM%
+exit /b %ERRORLEVEL%
+
+:: InstallCMakeProject - Builds the INSTALL project of CMake-based project
+:: Params: %1 buildDir, %2 == configuration
+:: NOTE the actual install dir is set during cmake run.
+:InstallCMakeProject
+pushd %1
+cecho {0D}Installing %2 %DEPENDENCY_NAME%. Please be patient, this will take a while.{# #}{\n}
+%INSTALL_CMD% INSTALL.%VCPROJ_FILE_EXT% /p:configuration=%2;platform=%VS_PLATFORM%
+set RET=%ERRORLEVEL%
+popd
+exit /b %RET%
diff --git a/win/readme.txt b/win/readme.txt
new file mode 100644
index 0000000000..a433cb1f53
--- /dev/null
+++ b/win/readme.txt
@@ -0,0 +1,48 @@
+== Windows Build Tools and Scripts ==
+
+This folder contains build tools and script for automatic building and deployment of IfcOpenShell's
+(IFCOS) dependencies.
+
+As a general guideline, .cmd files are non-standalone batch files that need to be run from command
+prompt or from other batch file and/or Visual Studio environment variables set and .bat files are
+standalone batch files that can be run from File Explorer too.
+
+
+== Usage Instructions ==
+
+Execute build-deps.cmd to fetch, build and install the dependencies. The batch file will print
+requirements for a successful execution. The script allows a few user-configurable build options
+which are listed in the usage instructions. Either edit the script file or set these values before
+running the script.
+
+build-deps.cmd expects a CMake generator as %1 and a build configuration type as %2. If the parameters
+are not provided, the default values are used ("Visual Studio 12 Win64" and RelWithDebInfo respectively).
+A build type (Build/Rebuild/Clean) can be provided as %3, if wanted (defaults to Build). See vs-cfg.cmd
+if you want to change the defaults. The batch file will create deps\ and deps-vs--installed\
+directories to the project root. Note that currently only libraries for one build configuration type
+can be installed at a time, so if wanting to switch between release and debug builds, run the build-deps.cmd
+again with the appropriate build type as %2.
+
+After the dependencies are build, execute run-cmake.bat. The batch file expects a CMake generator as
+%1, or alternatively if more parameters are provided, %* is passed for the CMake inkovation. If no %1
+is provided, the same default value as above is used. This batch script will create a folder of form
+build-vs- which will contain the solution and project files for Visual Studio.
+
+All of the dependencies are build as static libraries against the static run-time allowing the developer
+to effortlessly deploy standalone binaries.
+
+You can now build the project using the IfcOpenShell.sln file in the build folder. Build the INSTALL
+project if wanted. The project will installed to installed-vs- folder in the
+project's root folder and the required IfcOpenShell-Python parts are deployed to the Python's Lib
+folder.
+
+
+== Directory Structure ==
+
+| build-deps.cmd - Fetches and builds all needed dependencies for IFCOS
+| readme.txt - This file
+| run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS
+| vs-cfg.cmd - Utility file used by the build scripts
+|
++---sln - Contains the old Visual Studio solution and project files
+\---utils - Contains various utilities for the build scripts
diff --git a/win/run-cmake.bat b/win/run-cmake.bat
new file mode 100644
index 0000000000..1475d486bd
--- /dev/null
+++ b/win/run-cmake.bat
@@ -0,0 +1,101 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: ::
+:: This file is part of IfcOpenShell. ::
+:: ::
+:: IfcOpenShell is free software: you can redistribute it and/or modify ::
+:: it under the terms of the Lesser GNU General Public License as published by ::
+:: the Free Software Foundation, either version 3.0 of the License, or ::
+:: (at your option) any later version. ::
+:: ::
+:: IfcOpenShell is distributed in the hope that it will be useful, ::
+:: but WITHOUT ANY WARRANTY; without even the implied warranty of ::
+:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ::
+:: Lesser GNU General Public License for more details. ::
+:: ::
+:: You should have received a copy of the Lesser GNU General Public License ::
+:: along with this program. If not, see . ::
+:: ::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+@echo off
+echo.
+
+set PROJECT_NAME=IfcOpenShell
+
+:: Enable the delayed environment variable expansion needed in vs-cfg.cmd.
+setlocal EnableDelayedExpansion
+
+call vs-cfg.cmd %1
+
+set CMAKE_INSTALL_PREFIX=%CD%\..\installed-vs%VS_VER%-%TARGET_ARCH%
+
+set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
+IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
+pushd ..\%BUILD_DIR%
+
+set BOOST_ROOT=%DEPS_DIR%\boost
+REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost
+set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\vs%VS_VER%-%VS_PLATFORM%\lib
+set ICU_INCLUDE_DIR=%INSTALL_DIR%\icu\include
+set ICU_LIBRARY_DIR=%INSTALL_DIR%\icu\lib
+set OCC_INCLUDE_DIR=%INSTALL_DIR%\oce\include\oce
+set OCC_LIBRARY_DIR=%INSTALL_DIR%\oce\Win%ARCH_BITS%\lib
+set OPENCOLLADA_INCLUDE_DIR=%INSTALL_DIR%\OpenCOLLADA\include\opencollada
+set OPENCOLLADA_LIBRARY_DIR=%INSTALL_DIR%\OpenCOLLADA\lib\opencollada
+:: TODO 3ds Max SDK?
+set SWIG_DIR=%INSTALL_DIR%\swigwin
+set PATH=%PATH%;%SWIG_DIR%
+
+echo.
+cecho {0A}Script configuration:{# #}{\n}
+echo CMake Generator = %GENERATOR%
+echo All arguments = %*
+echo.
+cecho {0A}Dependency Environment Variables for %PROJECT_NAME%:{# #}{\n}
+echo BOOST_ROOT = %BOOST_ROOT%
+REM echo BOOST_INCLUDEDIR = %BOOST_INCLUDEDIR%
+echo BOOST_LIBRARYDIR = %BOOST_LIBRARYDIR%
+echo ICU_INCLUDE_DIR = %ICU_INCLUDE_DIR%
+echo ICU_LIBRARY_DIR = %ICU_LIBRARY_DIR%
+echo OCC_INCLUDE_DIR = %OCC_INCLUDE_DIR%
+echo OCC_LIBRARY_DIR = %OCC_LIBRARY_DIR%
+echo OPENCOLLADA_INCLUDE_DIR = %OPENCOLLADA_INCLUDE_DIR%
+echo OPENCOLLADA_LIBRARY_DIR = %OPENCOLLADA_LIBRARY_DIR%
+:: TODO Python
+echo SWIG_DIR = %SWIG_DIR%
+echo.
+echo CMAKE_INSTALL_PREFIX = %CMAKE_INSTALL_PREFIX%
+echo.
+
+set CMAKELISTS_DIR=..\cmake
+REM IF NOT EXIST %PROJECT_NAME%.sln. (
+ IF EXIST CMakeCache.txt. del /Q CMakeCache.txt
+ cecho {0D}Running CMake for %PROJECT_NAME%.{# #}{\n}
+ IF "%2"=="" (
+ REM No extra arguments provided, trust that GENERATOR is set properly.
+ cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%"
+ ) ELSE (
+ REM Extra arguments has been provided. As CMake options are typically of format -DSOMETHING:BOOL=ON,
+ REM i.e. they contain an equal sign, they will mess up the batch file argument parsing if the arguments are passed on
+ REM by splitting them %2 %3 %4 %5 %6 %7 %8 %9. In the extra argument case trust that user has provided the generator
+ REM as the first argument as pass all arguments as is by using %*.
+ cmake.exe %CMAKELISTS_DIR% -G %*
+ )
+ IF NOT %ERRORLEVEL%==0 GOTO :Error
+REM ) ELSE (
+ REM cecho {0A}%PROJECT_NAME%.sln exists. Skipping CMake call for %PROJECT_NAME%.{# #}{\n}
+ REM cecho {0A}Delete %CD%\%PROJECT_NAME%.sln to trigger a CMake rerun.{# #}{\n}
+REM )
+echo.
+
+goto :Finish
+
+:Error
+echo.
+cecho {0C}An error occurred! Aborting!{# #}{\n}
+goto :Finish
+
+:Finish
+popd
+set PATH=%ORIGINAL_PATH%
+endlocal
diff --git a/win/utils/7za.exe b/win/utils/7za.exe
new file mode 100644
index 0000000000..7f6bf86bc4
Binary files /dev/null and b/win/utils/7za.exe differ
diff --git a/win/utils/cecho test.bat b/win/utils/cecho test.bat
new file mode 100644
index 0000000000..0d872e2d30
--- /dev/null
+++ b/win/utils/cecho test.bat
@@ -0,0 +1,65 @@
+@echo off
+
+
+::
+:: cecho by thomas_polaert@yahoo.fr
+::
+echo cecho by thomas_polaert@yahoo.fr
+
+cecho
+
+cecho {00}00 - black{\n}
+cecho {01}01 - navy{\n}
+cecho {02}02 - green{\n}
+cecho {03}03 - teal{\n}
+cecho {04}04 - maroon{\n}
+cecho {05}05 - purple{\n}
+cecho {06}06 - olive{\n}
+cecho {07}07 - silver{\n}
+cecho {08}08 - gray{\n}
+cecho {09}09 - blue{\n}
+cecho {0A}0A - lime{\n}
+cecho {0B}0B - aqua{\n}
+cecho {0C}0C - red{\n}
+cecho {0D}0D - fuchisa{\n}
+cecho {0E}0E - yellow{\n}
+cecho {0F}0F - white{\n}
+
+echo.
+
+cecho {00}00 {10}10 {20}20 {30}30 {40}40 {50}50 {60}60 {70}70 {80}80 {90}90 {A0}A0 {B0}B0 {C0}80 {D0}90 {E0}A0 {F0}B0{\n}
+cecho {01}01 {11}11 {21}21 {31}31 {41}41 {51}51 {61}61 {71}71 {81}81 {91}91 {A1}A1 {B1}B1 {C1}81 {D1}91 {E1}A1 {F1}B1{\n}
+cecho {02}02 {12}12 {22}22 {32}32 {42}42 {52}52 {62}62 {72}72 {82}82 {92}92 {A2}A2 {B2}B2 {C2}82 {D2}92 {E2}A2 {F2}B2{\n}
+cecho {03}03 {13}13 {23}23 {33}33 {43}43 {53}53 {63}63 {73}73 {83}83 {93}93 {A3}A3 {B3}B3 {C3}83 {D3}93 {E3}A3 {F3}B3{\n}
+cecho {04}04 {14}14 {24}24 {34}34 {44}44 {54}54 {64}64 {74}74 {84}84 {94}94 {A4}A4 {B4}B4 {C4}84 {D4}94 {E4}A4 {F4}B4{\n}
+cecho {05}05 {15}15 {25}25 {35}35 {45}45 {55}55 {65}65 {75}75 {85}85 {95}95 {A5}A5 {B5}B5 {C5}85 {D5}95 {E5}A5 {F5}B5{\n}
+cecho {06}06 {16}16 {26}26 {36}36 {46}46 {56}56 {66}66 {76}76 {86}86 {96}96 {A6}A6 {B6}B6 {C6}86 {D6}96 {E6}A6 {F6}B6{\n}
+cecho {07}07 {17}17 {27}27 {37}37 {47}47 {57}57 {67}67 {77}77 {87}87 {97}97 {A7}A7 {B7}B7 {C7}87 {D7}97 {E7}A7 {F7}B7{\n}
+cecho {08}08 {18}18 {28}28 {38}38 {48}48 {58}58 {68}68 {78}78 {88}88 {98}98 {A8}A8 {B8}B8 {C8}88 {D8}98 {E8}A8 {F8}B8{\n}
+cecho {09}09 {19}19 {29}29 {39}39 {49}49 {59}59 {69}69 {79}79 {89}89 {99}99 {A9}A9 {B9}B9 {C9}89 {D9}99 {E9}A9 {F9}B9{\n}
+cecho {0A}0A {1A}1A {2A}2A {3A}3A {4A}4A {5A}5A {6A}6A {7A}7A {8A}8A {9A}9A {AA}AA {BA}BA {CA}8A {DA}9A {EA}AA {FA}BA{\n}
+cecho {0B}0B {1B}1B {2B}2B {3B}3B {4B}4B {5B}5B {6B}6B {7B}7B {8B}8B {9B}9B {AB}AB {BB}BB {CB}8B {DB}9B {EB}AB {FB}BB{\n}
+cecho {0C}0C {1C}1C {2C}2C {3C}3C {4C}4C {5C}5C {6C}6C {7C}7C {8C}8C {9C}9C {AC}AC {BC}BC {CC}8C {DC}9C {EC}AC {FC}BC{\n}
+cecho {0D}0D {1D}1D {2D}2D {3D}3D {4D}4D {5D}5D {6D}6D {7D}7D {8D}8D {9D}9D {AD}AD {BD}BD {CD}8D {DD}9D {ED}AD {FD}BD{\n}
+cecho {0E}0E {1E}1E {2E}2E {3E}3E {4E}4E {5E}5E {6E}6E {7E}7E {8E}8E {9E}9E {AE}AE {BE}BE {CE}8E {DE}9E {EE}AE {FE}BE{\n}
+cecho {0F}0F {1F}1F {2F}2F {3F}3F {4F}4F {5F}5F {6F}6F {7F}7F {8F}8F {9F}9F {AF}AF {BF}BF {CF}8F {DF}9F {EF}AF {FF}BF{\n}
+
+echo.
+
+cecho {silver}
+cecho {\uDA}
+cecho Escape charater {{
+echo.
+cecho {\u07 \u07}beep x2
+echo.
+cecho {\t}line #1{\n\t}line #2{\n\t}line #3
+echo.
+cecho {green}print green {default} and back to initial color
+echo.
+cecho {a red foreground on a white background}a red foreground on a white background {# #} and back to initial colors
+echo.
+cecho {blue gray}blue gray
+echo.
+cecho {purple yellow}purple yellow{\n silver}
+
+pause
\ No newline at end of file
diff --git a/win/utils/cecho.exe b/win/utils/cecho.exe
new file mode 100644
index 0000000000..9f310e5dc8
Binary files /dev/null and b/win/utils/cecho.exe differ
diff --git a/win/utils/cecho.txt b/win/utils/cecho.txt
new file mode 100644
index 0000000000..cdc61b2ffe
--- /dev/null
+++ b/win/utils/cecho.txt
@@ -0,0 +1 @@
+cecho is from http://www.codeproject.com/Articles/17033/Add-Colors-to-Batch-Files
\ No newline at end of file
diff --git a/win/utils/gnuwinlicense.txt b/win/utils/gnuwinlicense.txt
new file mode 100644
index 0000000000..33ab9958e0
--- /dev/null
+++ b/win/utils/gnuwinlicense.txt
@@ -0,0 +1 @@
+http://gnuwin32.sourceforge.net/license.html
\ No newline at end of file
diff --git a/win/utils/libeay32.dll b/win/utils/libeay32.dll
new file mode 100644
index 0000000000..8d31f86685
Binary files /dev/null and b/win/utils/libeay32.dll differ
diff --git a/win/utils/libiconv2.dll b/win/utils/libiconv2.dll
new file mode 100644
index 0000000000..544dd92f56
Binary files /dev/null and b/win/utils/libiconv2.dll differ
diff --git a/win/utils/libintl3.dll b/win/utils/libintl3.dll
new file mode 100644
index 0000000000..ec11e6b199
Binary files /dev/null and b/win/utils/libintl3.dll differ
diff --git a/win/utils/libssl32.dll b/win/utils/libssl32.dll
new file mode 100644
index 0000000000..a30ff0e9ea
Binary files /dev/null and b/win/utils/libssl32.dll differ
diff --git a/win/utils/license.txt b/win/utils/license.txt
new file mode 100644
index 0000000000..530ff3684d
--- /dev/null
+++ b/win/utils/license.txt
@@ -0,0 +1,29 @@
+ 7-Zip Command line version
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ License for use and distribution
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ 7-Zip Copyright (C) 1999-2010 Igor Pavlov.
+
+ 7za.exe is distributed under the GNU LGPL license
+
+ Notes:
+ You can use 7-Zip on any computer, including a computer in a commercial
+ organization. You don't need to register or pay for 7-Zip.
+
+
+ GNU LGPL information
+ --------------------
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You can receive a copy of the GNU Lesser General Public License from
+ http://www.gnu.org/
diff --git a/win/utils/wget.exe b/win/utils/wget.exe
new file mode 100644
index 0000000000..54b372e6bf
Binary files /dev/null and b/win/utils/wget.exe differ
diff --git a/win/vs-cfg.cmd b/win/vs-cfg.cmd
new file mode 100644
index 0000000000..dbf2f405bd
--- /dev/null
+++ b/win/vs-cfg.cmd
@@ -0,0 +1,160 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: ::
+:: This file is part of IfcOpenShell. ::
+:: ::
+:: IfcOpenShell is free software: you can redistribute it and/or modify ::
+:: it under the terms of the Lesser GNU General Public License as published by ::
+:: the Free Software Foundation, either version 3.0 of the License, or ::
+:: (at your option) any later version. ::
+:: ::
+:: IfcOpenShell is distributed in the hope that it will be useful, ::
+:: but WITHOUT ANY WARRANTY; without even the implied warranty of ::
+:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ::
+:: Lesser GNU General Public License for more details. ::
+:: ::
+:: You should have received a copy of the Lesser GNU General Public License ::
+:: along with this program. If not, see . ::
+:: ::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:: This script initializes various Visual Studio -related environment variables needed for building
+:: This batch file expects CMake generator as %1 and build configuration type as %2.
+:: NOTE: The delayed environment variable expansion needs to be enabled before calling this.
+
+@echo off
+
+:: TOOLS is the path where the Windows build scripts reside.
+set TOOLS=%CD%
+
+set GENERATOR=%1
+
+:: TODO IDEA: Take more user-friendly VS generators and convert them to the CMake ones?
+:: F.ex. "vs2013-32" and/or "vc14-64"
+
+:: TODO Print CMake and VS versions. Maybe in build-deps.cmd would be better than here.
+:: Make CMake missing a fatal error and abort the script.
+
+:: Supported Visual Studio versions:
+set GENERATOR_VS2015_32="Visual Studio 14 2015"
+set GENERATOR_VS2015_64="Visual Studio 14 2015 Win64"
+:: TODO Check CMake version and convert possible new format (>= 3.0) generator names
+:: to the old versions if using older CMake for VS <= 2013,
+:: see http://www.cmake.org/cmake/help/v3.0/release/3.0.0.html#other-changes
+set GENERATOR_VS2013_32="Visual Studio 12"
+set GENERATOR_VS2013_64="Visual Studio 12 Win64"
+set GENERATOR_VS2012_32="Visual Studio 11"
+set GENERATOR_VS2012_64="Visual Studio 11 Win64"
+set GENERATOR_VS2010_32="Visual Studio 10"
+set GENERATOR_VS2010_64="Visual Studio 10 Win64"
+set GENERATOR_VS2008_32="Visual Studio 9 2008"
+set GENERATOR_VS2008_64="Visual Studio 9 2008 Win64"
+set GENERATOR_DEFAULT=%GENERATOR_VS2015_64%
+
+IF "!GENERATOR!"=="" (
+ set GENERATOR=%GENERATOR_DEFAULT%
+ utils\cecho {0E}vs-cfg.cmd: Warning: Generator not passed - using the default %GENERATOR_DEFAULT%.{# #}{\n}
+)
+
+IF NOT !GENERATOR!==%GENERATOR_VS2008_32% IF NOT !GENERATOR!==%GENERATOR_VS2008_64% (
+IF NOT !GENERATOR!==%GENERATOR_VS2010_32% IF NOT !GENERATOR!==%GENERATOR_VS2010_64% (
+IF NOT !GENERATOR!==%GENERATOR_VS2012_32% IF NOT !GENERATOR!==%GENERATOR_VS2012_64% (
+IF NOT !GENERATOR!==%GENERATOR_VS2013_32% IF NOT !GENERATOR!==%GENERATOR_VS2013_64% (
+IF NOT !GENERATOR!==%GENERATOR_VS2015_32% IF NOT !GENERATOR!==%GENERATOR_VS2015_64% (
+ utils\cecho {0C}vs-cfg.cmd: Invalid or unsupported CMake generator string passed: !GENERATOR!. Cannot proceed, aborting!{# #}{\n}
+ GOTO :EOF
+)))))
+
+:: Figure out the build configuration from the CMake generator string.
+:: Are we building 32-bit or 64-bit version.
+set ARCH_BITS=32
+set TARGET_ARCH=x86
+:: Visual Studio platform name, Win32 (i.e. x86) or x64.
+set VS_PLATFORM=Win32
+
+:: Split the string for closer inspection.
+:: VS_VER and VC_VER are convenience variables used f.ex. for filenames.
+set GENERATOR_NO_DOUBLEQUOTES=%GENERATOR:"=%
+set GENERATOR_SPLIT=%GENERATOR_NO_DOUBLEQUOTES: =,%
+FOR %%i IN (%GENERATOR_SPLIT%) DO (
+ IF %%i==14 (
+ set VS_VER=2015
+ set VC_VER=14
+ )
+ IF %%i==12 (
+ set VS_VER=2013
+ set VC_VER=12
+ )
+ IF %%i==11 (
+ set VS_VER=2012
+ set VC_VER=11
+ )
+ IF %%i==10 (
+ set VS_VER=2010
+ set VC_VER=10
+ )
+ IF %%i==2008 (
+ set VS_VER=2008
+ set VC_VER=9
+ )
+ REM Are going to perform a 64-bit build?
+ IF %%i==Win64 (
+ set ARCH_BITS=64
+ set TARGET_ARCH=x64
+ set VS_PLATFORM=x64
+ )
+)
+
+:: VS project file extension is different on older VS versions
+set VCPROJ_FILE_EXT=vcxproj
+IF %VS_VER%==2008 set VCPROJ_FILE_EXT=vcproj
+
+:: Set up variables depending on the used build configuration type.
+set BUILD_CFG=%2
+
+:: The default build types provided by CMake
+set BUILD_CFG_MINSIZEREL=MinSizeRel
+set BUILD_CFG_RELEASE=Release
+set BUILD_CFG_RELWITHDEBINFO=RelWithDebInfo
+set BUILD_CFG_DEBUG=Debug
+set BUILD_CFG_DEFAULT=%BUILD_CFG_RELWITHDEBINFO%
+
+IF "!BUILD_CFG!"=="" (
+ set BUILD_CFG=%BUILD_CFG_DEFAULT%
+ utils\cecho {0E}vs-cfg.cmd: Warning: BUILD_CFG not specified - using the default %BUILD_CFG_DEFAULT%{# #}{\n}
+)
+IF NOT !BUILD_CFG!==%BUILD_CFG_MINSIZEREL% IF NOT !BUILD_CFG!==%BUILD_CFG_RELEASE% (
+IF NOT !BUILD_CFG!==%BUILD_CFG_RELWITHDEBINFO% IF NOT !BUILD_CFG!==%BUILD_CFG_DEBUG% (
+ utils\cecho {0C}vs-cfg.cmd: Invalid or unsupported CMake build configuration type passed: !BUILD_CFG!. Cannot proceed, aborting!{# #}{\n}
+ exit /b 1
+))
+
+:: DEBUG_OR_RELEASE and DEBUG_OR_RELEASE_LOWERCASE are "Debug" and "debug" for Debug build and "Release" and
+:: "release" for all of the Release variants.
+:: POSTFIX_D, POSTFIX_UNDERSCORE_D and POSTFIX_UNDERSCORE_DEBUG are helpers for performing file copies and
+:: checking for existence of files. In release build these variables are empty.
+set DEBUG_OR_RELEASE=Release
+set DEBUG_OR_RELEASE_LOWERCASE=release
+set POSTFIX_D=
+set POSTFIX_UNDERSCORE_D=
+set POSTFIX_UNDERSCORE_DEBUG=
+IF %BUILD_CFG%==Debug (
+ set DEBUG_OR_RELEASE=Debug
+ set DEBUG_OR_RELEASE_LOWERCASE=debug
+ set POSTFIX_D=d
+ set POSTFIX_UNDERSCORE_D=_d
+ set POSTFIX_UNDERSCORE_DEBUG=_debug
+)
+
+:: Populate path variables
+cd ..\
+set ORIGINAL_PATH=%PATH%
+set PATH=%PATH%;"%CD%\win\utils"
+
+:: Fetch and build the dependencies to a dedicated directory depending on the used VS version and target architecture.
+:: NOTE For IfcOpenShell we can build all of our deps both x86 and x64 using different VS versions in the same directories
+:: so no need for -%VS_VER%-%TARGET_ARCH% postfix.
+:: set DEPS_DIR=%CD%\deps-%VS_VER%-%TARGET_ARCH%
+set DEPS_DIR=%CD%\deps
+set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%TARGET_ARCH%-installed
+REM set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%TARGET_ARCH%-%DEBUG_OR_RELEASE_LOWERCASE%-installed
+cd %TOOLS%