build-ifcopenshell & install-ifcopenshell batch files

This commit is contained in:
Stinkfist0
2015-12-04 17:01:33 +02:00
parent 0877bb0ac3
commit 3224a2cf83
7 changed files with 115 additions and 10 deletions
+14 -5
View File
@@ -33,17 +33,26 @@ Users are advised to build IfcOpenShell using the CMake file provided in
the cmake/ folder. the cmake/ folder.
The preferred way to fetch and build this project's dependencies is to use the build scripts The preferred way to fetch and build this project's dependencies is to use the build scripts
in win/ folder. See [win/readme.md] for more information. Instructions in a nutshell in win/ folder. **See [win/readme.md] for more information**. Instructions in a nutshell
(**assuming Visual Studio 2015 x64 environment variables set**): (**assuming Visual Studio 2015 x64 environment variables set**):
> git clone https://github.com/IfcOpenShell/IfcOpenShell.git > git clone https://github.com/IfcOpenShell/IfcOpenShell.git
> cd oce\win > cd IfcOpenShell\win
> build-deps.cmd (defaults to RelWithDebInfo build) > build-deps.cmd
> run-cmake.bat > run-cmake.bat
You can now open and build the solution file in Visual Studio:
> ..\build-vs2015-x64\IfcOpenShell.sln > ..\build-vs2015-x64\IfcOpenShell.sln
You can now build the solution using the `RelWithDebInfo` configuration (freshly created solution by CMake defaults to `Debug`). As the scripts default to using the `RelWithDebInfo` configuration, and a freshly created solution by CMake defaults
Build the `INSTALL` project to deploy the headers and binaries into a single location if wanted/needed. to `Debug`, make sure to switch the used build configuration. Build the `INSTALL` project (right-click -> Project
Only) to deploy the headers and binaries into a single location if wanted/needed.
Alternatively, one can use the utility batch files to build and install the project easily from the command-line:
> build-ifcopenshell.cmd
> install-ifcopenshell.cmd
Alternatively, the old Visual Studio solution and project files requiring manual work can Alternatively, the old Visual Studio solution and project files requiring manual work can
be found from the win/sln folder. be found from the win/sln folder.
+1 -2
View File
@@ -18,7 +18,7 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: This batch file expects CMake generator as %1 and build configuration type as %2. If not provided, :: 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) :: a deduced generator 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. :: Optionally a build type (Build/Rebuild/Clean) can be passed as %3.
@echo off @echo off
@@ -72,7 +72,6 @@ set MSBUILD_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS% /t:%BUILD_TYPE%
REM /clp:ErrorsOnly;WarningsOnly REM /clp:ErrorsOnly;WarningsOnly
:: Note BUILD_TYPE not passed, Clean e.g. wouldn't delete the installed files. :: Note BUILD_TYPE not passed, Clean e.g. wouldn't delete the installed files.
set INSTALL_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS% set INSTALL_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS%
set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
echo. echo.
+46
View File
@@ -0,0 +1,46 @@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ::
:: 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 <http://www.gnu.org/licenses/>. ::
:: ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: This batch file expects CMake generator as %1 and build configuration type as %2. If not provided,
:: a deduced generator will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd)
:: Possible extra parameters are passed for the MSBuild call.
@echo off
set PROJECT_NAME=IfcOpenShell
:: Enable the delayed environment variable expansion needed in VSConfig.cmd.
setlocal EnableDelayedExpansion
call vs-cfg.cmd %1 %2
IF NOT %ERRORLEVEL%==0 GOTO :Error
echo.
call cecho.cmd 0 13 "Building %VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME%"
MSBuild ..\%BUILD_DIR%\%PROJECT_NAME%.sln /nologo /m /p:Platform=%VS_PLATFORM% /p:Configuration=%BUILD_CFG% %3 %4 %5 %6 %7 %8 %9
IF NOT %ERRORLEVEL%==0 GOTO :Error
echo.
call cecho.cmd 0 10 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% build finished."
goto :End
:Error
echo.
call %~dp0\utils\cecho.cmd 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% build failed!"
:End
endlocal
+46
View File
@@ -0,0 +1,46 @@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ::
:: 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 <http://www.gnu.org/licenses/>. ::
:: ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: This batch file expects CMake generator as %1 and build configuration type as %2. If not provided,
:: a deduced generator will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd)
:: Possible extra parameters are passed for the MSBuild call.
@echo off
set PROJECT_NAME=IfcOpenShell
:: Enable the delayed environment variable expansion needed in VSConfig.cmd.
setlocal EnableDelayedExpansion
call vs-cfg.cmd %1 %2
IF NOT %ERRORLEVEL%==0 GOTO :Error
echo.
call cecho.cmd 0 13 "Installing %VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME%"
MSBuild ..\%BUILD_DIR%\INSTALL.%VCPROJ_FILE_EXT% /nologo /m /p:Platform=%VS_PLATFORM% /p:Configuration=%BUILD_CFG% %3 %4 %5 %6 %7 %8 %9
IF NOT %ERRORLEVEL%==0 GOTO :Error
echo.
call cecho.cmd 0 10 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation finished."
goto :End
:Error
echo.
call %~dp0\utils\cecho.cmd 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation failed!"
:End
endlocal
+6 -2
View File
@@ -31,8 +31,10 @@ Note that building IfcOpenShell as 64-bit is recommended as many of real life IF
easily more than 2 GBs of RAM while converting. easily more than 2 GBs of RAM while converting.
After this, one can build the project using the `IfcOpenShell.sln` file in the build folder. Build the `INSTALL` project After this, one can build the project using the `IfcOpenShell.sln` file in the build folder. Build the `INSTALL` project
if wanted. The project will be installed to `installed-vs<VERSION>-<ARCHITECTURE>\` folder in the project's root if wanted. Convenience batch files `build-ifcopenshell.cmd` and `install-ifcopenshell.cmd` can also be used. The batch files
folder and the required IfcOpenShell-Python parts are deployed to the `<PYTHONPATH>\Lib\site-packages\` folder. expect `%1` and `%2` in same fashion as above and possible extra parameters are passed for the `MSBuild`call. The project will
be installed to `installed-vs<VERSION>-<ARCHITECTURE>\` folder in the project's root folder and the required IfcOpenShell-Python
parts are deployed to the `<PYTHONPATH>\Lib\site-packages\` folder.
**Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer **Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer
to effortlessly deploy standalone IFCOS binaries. to effortlessly deploy standalone IFCOS binaries.
@@ -49,6 +51,8 @@ Directory Structure
\---win \---win
| build-deps.cmd - Fetches and builds all needed dependencies for IFCOS | build-deps.cmd - Fetches and builds all needed dependencies for IFCOS
| BuildDepsCache-<ARCH>.txt - Cache file created by build-deps.cmd | BuildDepsCache-<ARCH>.txt - Cache file created by build-deps.cmd
| build-ifcopenshell.cmd - Builds IFCOS
| install-ifcopenshell.cmd - Builds IFCOS's INSTALL project
| readme.md - This file | readme.md - This file
| run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS | run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS
| vs-cfg.cmd - Utility file used by the build scripts | vs-cfg.cmd - Utility file used by the build scripts
-1
View File
@@ -35,7 +35,6 @@ pushd ..
set CMAKE_INSTALL_PREFIX=%CD%\installed-vs%VS_VER%-%TARGET_ARCH% set CMAKE_INSTALL_PREFIX=%CD%\installed-vs%VS_VER%-%TARGET_ARCH%
popd popd
set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR% IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
pushd ..\%BUILD_DIR% pushd ..\%BUILD_DIR%
+2
View File
@@ -166,6 +166,8 @@ pushd ..
set DEPS_DIR=%CD%\deps set DEPS_DIR=%CD%\deps
set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%TARGET_ARCH%-installed 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 REM set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%TARGET_ARCH%-%DEBUG_OR_RELEASE_LOWERCASE%-installed
:: BUILD_DIR is a relative build directory used for CMake-based projects
set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
popd popd
GOTO :EOF GOTO :EOF