mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
Windows/MSVC: support spaces in the IfcOpenShell build directory's path. re: #171
This commit is contained in:
committed by
Thomas Krijnen
parent
99bde93af5
commit
37905c6725
@@ -34,6 +34,9 @@ Dependencies
|
|||||||
|
|
||||||
Building IfcOpenShell
|
Building IfcOpenShell
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
**Note:** The path where the source code is cloned to can contain spaces but non-ASCII characters are very likely to cause problems with the build.
|
||||||
|
|
||||||
### Compiling on Windows
|
### Compiling on Windows
|
||||||
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**.
|
in win/ folder. **See [win/readme.md] for more information**.
|
||||||
@@ -53,9 +56,8 @@ As the scripts default to using the `RelWithDebInfo` configuration, and a freshl
|
|||||||
to `Debug`, make sure to switch the used build configuration. Build the `INSTALL` project (right-click -> Project
|
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.
|
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:
|
Alternatively, one can use the utility batch file(s) to build and install the project easily from the command-line
|
||||||
|
(installing a project will build it also, if required):
|
||||||
> build-ifcopenshell.bat
|
|
||||||
> install-ifcopenshell.bat
|
> install-ifcopenshell.bat
|
||||||
|
|
||||||
#### Using MSYS2 + MinGW
|
#### Using MSYS2 + MinGW
|
||||||
@@ -65,7 +67,6 @@ Start the MSYS2 Shell and then:
|
|||||||
$ cd IfcOpenShell/win
|
$ cd IfcOpenShell/win
|
||||||
$ ./build-deps.sh
|
$ ./build-deps.sh
|
||||||
$ ./run-cmake.sh
|
$ ./run-cmake.sh
|
||||||
$ ./build-ifcopenshell.sh
|
|
||||||
$ ./install-ifcopenshell.sh
|
$ ./install-ifcopenshell.sh
|
||||||
|
|
||||||
#### Using Bash on Ubuntu on Windows
|
#### Using Bash on Ubuntu on Windows
|
||||||
@@ -79,16 +80,16 @@ The following instructions are for Ubuntu, modify as required for other operatin
|
|||||||
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
|
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
|
||||||
meant to be used for a typical IfcOpenShell workspace setup.
|
meant to be used for a typical IfcOpenShell workspace setup.
|
||||||
|
|
||||||
Install most of the prerequisites and dependencies:
|
**1)** Install most of the prerequisites and dependencies:
|
||||||
|
|
||||||
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libicu-dev
|
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libicu-dev
|
||||||
|
|
||||||
There might be an Open CASCADE package in your operating system's software repository (see http://opencascade.org
|
**2a)** Either use an Open CASCADE package from your operating system's software repository (see http://opencascade.org
|
||||||
for additional information):
|
for additional information)
|
||||||
|
|
||||||
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
|
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
|
||||||
|
|
||||||
If not, you will need to compile Open CASCADE yourself (note that the build takes a long time):
|
**2b)** or (if not available, or the latest code is wanted) compile Open CASCADE yourself (note that the build takes a long time):
|
||||||
|
|
||||||
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
|
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
|
||||||
$ git clone https://github.com/tpaviot/oce.git
|
$ git clone https://github.com/tpaviot/oce.git
|
||||||
@@ -98,7 +99,7 @@ If not, you will need to compile Open CASCADE yourself (note that the build take
|
|||||||
$ make -j
|
$ make -j
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
|
|
||||||
For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
|
**3)** For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
|
||||||
|
|
||||||
$ sudo apt-get install libpcre3-dev
|
$ sudo apt-get install libpcre3-dev
|
||||||
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
|
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
|
||||||
@@ -110,11 +111,11 @@ For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA
|
|||||||
$ make -j
|
$ make -j
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
|
|
||||||
For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
|
**4)** For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
|
||||||
|
|
||||||
$ sudo apt-get install python-all-dev swig
|
$ sudo apt-get install python-all-dev swig
|
||||||
|
|
||||||
To build IfcOpenShell please take the following steps. Alternatively use environment variables for setting the
|
**5)** To build IfcOpenShell please take the following steps. Alternatively use environment variables for setting the
|
||||||
dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA_INCLUDE_DIR` and `OPENCOLLADA_LIBRARY_DIR`
|
dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA_INCLUDE_DIR` and `OPENCOLLADA_LIBRARY_DIR`
|
||||||
(and potentially `PCRE_LIBRARY_DIR`) are needed if building with COLLADA support. (`-DCOLLADA_SUPPORT=0` disables it).
|
(and potentially `PCRE_LIBRARY_DIR`) are needed if building with COLLADA support. (`-DCOLLADA_SUPPORT=0` disables it).
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@ dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA
|
|||||||
|
|
||||||
If all worked out correctly you can now use IfcOpenShell. See the examples below.
|
If all worked out correctly you can now use IfcOpenShell. See the examples below.
|
||||||
|
|
||||||
Install the project if wanted:
|
**6)** Install the project if wanted:
|
||||||
|
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
|
|
||||||
|
|||||||
+17
-12
@@ -118,7 +118,7 @@ MESSAGE(STATUS "Boost libraries found in ${Boost_LIBRARY_DIRS}")
|
|||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
# set(SOME_LIRARIES foo bar)
|
# set(SOME_LIRARIES foo bar)
|
||||||
# add_debug_variants(SOME_LIRARIES "${SOME_LIRARIES}" "d")
|
# add_debug_variants(SOME_LIRARIES "${SOME_LIRARIES}" d)
|
||||||
# "foo bar" -> "optimized foo debug food optimized bar debug bard"
|
# "foo bar" -> "optimized foo debug food optimized bar debug bard"
|
||||||
# or
|
# or
|
||||||
# set(SOME_LIRARIES path/foo.lib)
|
# set(SOME_LIRARIES path/foo.lib)
|
||||||
@@ -128,19 +128,24 @@ MESSAGE(STATUS "Boost libraries found in ${Boost_LIBRARY_DIRS}")
|
|||||||
# make sure the lib variable ends with not just contains it.
|
# make sure the lib variable ends with not just contains it.
|
||||||
function(add_debug_variants NAME LIBRARIES POSTFIX)
|
function(add_debug_variants NAME LIBRARIES POSTFIX)
|
||||||
set(LIBRARIES_STR "${LIBRARIES}")
|
set(LIBRARIES_STR "${LIBRARIES}")
|
||||||
set(LIBRARIES "")
|
# the result, "optimized <lib> debug <lib>", needs to be a list instead of a string
|
||||||
foreach(lib ${LIBRARIES_STR})
|
foreach(lib ${LIBRARIES_STR})
|
||||||
if("${lib}" MATCHES ".lib")
|
list(APPEND LIBRARIES optimized)
|
||||||
|
if ("${lib}" MATCHES ".lib")
|
||||||
string(REPLACE ".lib" "" lib ${lib})
|
string(REPLACE ".lib" "" lib ${lib})
|
||||||
set(LIBRARIES "${LIBRARIES} optimized ${lib}.lib")
|
list(APPEND LIBRARIES ${lib}.lib)
|
||||||
set(LIBRARIES "${LIBRARIES} debug ${lib}${POSTFIX}.lib")
|
|
||||||
else()
|
else()
|
||||||
set(LIBRARIES "${LIBRARIES} optimized ${lib}")
|
list(APPEND LIBRARIES ${lib})
|
||||||
set(LIBRARIES "${LIBRARIES} debug ${lib}${POSTFIX}")
|
endif()
|
||||||
|
|
||||||
|
list(APPEND LIBRARIES debug)
|
||||||
|
if ("${lib}" MATCHES ".lib")
|
||||||
|
string(REPLACE ".lib" "" lib ${lib})
|
||||||
|
list(APPEND LIBRARIES ${lib}${POSTFIX}.lib)
|
||||||
|
else()
|
||||||
|
list(APPEND LIBRARIES ${lib}${POSTFIX})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
string(STRIP ${LIBRARIES} LIBRARIES) # leading and trailing whitespace cause confusion
|
|
||||||
separate_arguments(LIBRARIES) # "optimized <lib> debug <lib>" needs to be a list instead of a string
|
|
||||||
set(${NAME} ${LIBRARIES} PARENT_SCOPE)
|
set(${NAME} ${LIBRARIES} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@@ -190,7 +195,7 @@ endforeach()
|
|||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(-DHAVE_NO_DLL)
|
add_definitions(-DHAVE_NO_DLL)
|
||||||
add_debug_variants(OPENCASCADE_LIBRARIES "${OPENCASCADE_LIBRARIES}" "d")
|
add_debug_variants(OPENCASCADE_LIBRARIES "${OPENCASCADE_LIBRARIES}" d)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(UNICODE_SUPPORT)
|
IF(UNICODE_SUPPORT)
|
||||||
@@ -216,7 +221,7 @@ IF(UNICODE_SUPPORT)
|
|||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
FIND_LIBRARY(icudt NAMES icudt PATHS ${ICU_LIBRARY_DIR} NO_DEFAULT_PATH)
|
FIND_LIBRARY(icudt NAMES icudt PATHS ${ICU_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||||
SET(ICU_LIBRARIES ${icu} ${icudt})
|
SET(ICU_LIBRARIES ${icu} ${icudt})
|
||||||
add_debug_variants(ICU_LIBRARIES "${ICU_LIBRARIES}" "d")
|
add_debug_variants(ICU_LIBRARIES "${ICU_LIBRARIES}" d)
|
||||||
# TODO MinGW build would appear to be using dynamic ICU regardless of this definition.
|
# TODO MinGW build would appear to be using dynamic ICU regardless of this definition.
|
||||||
ADD_DEFINITIONS(-DU_STATIC_IMPLEMENTATION) # required for static ICU
|
ADD_DEFINITIONS(-DU_STATIC_IMPLEMENTATION) # required for static ICU
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -286,7 +291,7 @@ IF(COLLADA_SUPPORT)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
add_debug_variants(OPENCOLLADA_LIBRARIES "${OPENCOLLADA_LIBRARIES}" "d")
|
add_debug_variants(OPENCOLLADA_LIBRARIES "${OPENCOLLADA_LIBRARIES}" d)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA. Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed.")
|
MESSAGE(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA. Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed.")
|
||||||
|
|||||||
+25
-25
@@ -60,8 +60,8 @@ IF NOT "!BUILD_TYPE!"=="Build" IF NOT "!BUILD_TYPE!"=="Rebuild" IF NOT "!BUILD_T
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: Make sure deps and install folders exists.
|
:: Make sure deps and install folders exists.
|
||||||
IF NOT EXIST %DEPS_DIR%. mkdir %DEPS_DIR%
|
IF NOT EXIST "%DEPS_DIR%". mkdir "%DEPS_DIR%"
|
||||||
IF NOT EXIST %INSTALL_DIR%. mkdir %INSTALL_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 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%
|
IF %VS_VER%==2008 set PATH=C:\Windows\Microsoft.NET\Framework\v3.5;%PATH%
|
||||||
@@ -134,7 +134,7 @@ echo Build started at %START_TIME%.
|
|||||||
set BUILD_STARTED=TRUE
|
set BUILD_STARTED=TRUE
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
cd %DEPS_DIR%
|
cd "%DEPS_DIR%"
|
||||||
|
|
||||||
:: Note all of the depedencies have approriate label so that user can easily skip something if wanted
|
:: Note all of the depedencies have approriate label so that user can easily skip something if wanted
|
||||||
:: by modifying this file and using goto.
|
:: by modifying this file and using goto.
|
||||||
@@ -145,7 +145,7 @@ set DEPENDENCY_NAME=Boost %BOOST_VERSION%
|
|||||||
set DEPENDENCY_DIR="%DEPS_DIR%\boost"
|
set DEPENDENCY_DIR="%DEPS_DIR%\boost"
|
||||||
:: Version string with underscores instead of dots.
|
:: Version string with underscores instead of dots.
|
||||||
set BOOST_VER=%BOOST_VERSION:.=_%
|
set BOOST_VER=%BOOST_VERSION:.=_%
|
||||||
set BOOST_ROOT=%DEPS_DIR%\boost
|
REM set BOOST_ROOT=%DEPS_DIR%\boost
|
||||||
REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost
|
REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost
|
||||||
set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\%VS_PLATFORM%\lib
|
set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\%VS_PLATFORM%\lib
|
||||||
:: NOTE Also zip download exists, if encountering problems with 7z for some reason.
|
:: NOTE Also zip download exists, if encountering problems with 7z for some reason.
|
||||||
@@ -383,7 +383,7 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|||||||
call :ExtractArchive %SWIG_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\swigwin"
|
call :ExtractArchive %SWIG_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\swigwin"
|
||||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
IF EXIST "%DEPS_DIR%\swigwin-%SWIG_VERSION%". (
|
IF EXIST "%DEPS_DIR%\swigwin-%SWIG_VERSION%". (
|
||||||
pushd %DEPS%
|
pushd "%DEPS_DIR%"
|
||||||
ren swigwin-%SWIG_VERSION% swigwin
|
ren swigwin-%SWIG_VERSION% swigwin
|
||||||
popd
|
popd
|
||||||
)
|
)
|
||||||
@@ -391,7 +391,7 @@ IF EXIST "%DEPS_DIR%\swigwin\". robocopy "%DEPS_DIR%\swigwin" "%INSTALL_DIR%\swi
|
|||||||
|
|
||||||
:Successful
|
:Successful
|
||||||
echo.
|
echo.
|
||||||
call %~dp0\utils\cecho.cmd 0 10 "%PROJECT_NAME% dependencies built."
|
call "%~dp0\utils\cecho.cmd" 0 10 "%PROJECT_NAME% dependencies built."
|
||||||
set IFCOS_SCRIPT_RET=0
|
set IFCOS_SCRIPT_RET=0
|
||||||
goto :Finish
|
goto :Finish
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ echo.
|
|||||||
call :PrintUsage
|
call :PrintUsage
|
||||||
:Error
|
:Error
|
||||||
echo.
|
echo.
|
||||||
call %~dp0\utils\cecho.cmd 0 12 "An error occurred! Aborting!"
|
call "%~dp0\utils\cecho.cmd" 0 12 "An error occurred! Aborting!"
|
||||||
set IFCOS_SCRIPT_RET=1
|
set IFCOS_SCRIPT_RET=1
|
||||||
goto :Finish
|
goto :Finish
|
||||||
|
|
||||||
@@ -423,20 +423,20 @@ echo.
|
|||||||
echo Build ended at %END_TIME%. Time elapsed %hh%:%mm%:%ss%.%cc%.
|
echo Build ended at %END_TIME%. Time elapsed %hh%:%mm%:%ss%.%cc%.
|
||||||
:BuildTimeSkipped
|
:BuildTimeSkipped
|
||||||
set PATH=%ORIGINAL_PATH%
|
set PATH=%ORIGINAL_PATH%
|
||||||
cd %~dp0
|
cd "%~dp0"
|
||||||
exit /b %IFCOS_SCRIPT_RET%
|
exit /b %IFCOS_SCRIPT_RET%
|
||||||
|
|
||||||
::::::::::::::::::::::::::::::::::::: Subroutines :::::::::::::::::::::::::::::::::::::
|
::::::::::::::::::::::::::::::::::::: Subroutines :::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
:: DownloadFile - Downloads a file using wget
|
:: DownloadFile - Downloads a file using PowerShell
|
||||||
:: Params: %1 url, %2 destinationDir, %3 filename
|
:: Params: %1 url, %2 destinationDir, %3 filename
|
||||||
:DownloadFile
|
:DownloadFile
|
||||||
pushd %2
|
pushd "%2"
|
||||||
IF NOT EXIST "%3". (
|
if not exist "%~3". (
|
||||||
call cecho.cmd 0 13 "Downloading %DEPENDENCY_NAME% into %2."
|
call cecho.cmd 0 13 "Downloading %DEPENDENCY_NAME% into %~2."
|
||||||
powershell -Command "$webClient = new-object System.Net.WebClient; $webClient.DownloadFile('%1', '%3')"
|
powershell -Command "$webClient = new-object System.Net.WebClient; $webClient.DownloadFile('%1', '%3')"
|
||||||
REM Old wget version in case someone has problem with PowerShell: wget --no-check-certificate %1
|
REM Old wget version in case someone has problem with PowerShell: wget --no-check-certificate %1
|
||||||
) ELSE (
|
) else (
|
||||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already downloaded. Skipping."
|
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already downloaded. Skipping."
|
||||||
)
|
)
|
||||||
set RET=%ERRORLEVEL%
|
set RET=%ERRORLEVEL%
|
||||||
@@ -446,11 +446,11 @@ exit /b %RET%
|
|||||||
:: ExtractArchive - Extracts an archive file using 7-zip
|
:: ExtractArchive - Extracts an archive file using 7-zip
|
||||||
:: Params: %1 filename, %2 destinationDir, %3 dirAfterExtraction
|
:: Params: %1 filename, %2 destinationDir, %3 dirAfterExtraction
|
||||||
:ExtractArchive
|
:ExtractArchive
|
||||||
IF NOT EXIST "%3". (
|
if not exist "%~3". (
|
||||||
call cecho.cmd 0 13 "Extracting %DEPENDENCY_NAME% into %2."
|
call cecho.cmd 0 13 "Extracting %DEPENDENCY_NAME% into %~2."
|
||||||
7za x %1 -y -o%2
|
7za x %1 -y -o%2
|
||||||
) ELSE (
|
) else (
|
||||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already extracted into %3. Skipping."
|
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already extracted into %~3. Skipping."
|
||||||
)
|
)
|
||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
|
|
||||||
@@ -458,12 +458,12 @@ exit /b %ERRORLEVEL%
|
|||||||
:: Params: %1 gitUrl, %2 destDir
|
:: Params: %1 gitUrl, %2 destDir
|
||||||
:: F.ex. call :GitCloneRepository https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPS_DIR%\OpenCOLLADA\"
|
:: F.ex. call :GitCloneRepository https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPS_DIR%\OpenCOLLADA\"
|
||||||
:GitCloneOrPullRepository
|
:GitCloneOrPullRepository
|
||||||
IF NOT EXIST %2. (
|
if not exist "%~2". (
|
||||||
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %2."
|
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
|
||||||
pushd "%DEPS_DIR%"
|
pushd "%DEPS_DIR%"
|
||||||
call git clone %1 %2
|
call git clone %1 %2
|
||||||
set RET=%ERRORLEVEL%
|
set RET=%ERRORLEVEL%
|
||||||
) ELSE (
|
) else (
|
||||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Pulling latest changes."
|
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Pulling latest changes."
|
||||||
pushd %2
|
pushd %2
|
||||||
call git pull
|
call git pull
|
||||||
@@ -476,14 +476,14 @@ exit /b %RET%
|
|||||||
:: Params: %1 gitUrl, %2 destDir, %3 revision
|
:: Params: %1 gitUrl, %2 destDir, %3 revision
|
||||||
:: F.ex. call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6
|
:: F.ex. call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6
|
||||||
:GitCloneAndCheckoutRevision
|
:GitCloneAndCheckoutRevision
|
||||||
IF NOT EXIST "%2". (
|
if not exist "%~2". (
|
||||||
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %2."
|
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
|
||||||
pushd "%DEPS_DIR%"
|
pushd "%DEPS_DIR%"
|
||||||
call git clone %1 %2
|
call git clone %1 %2
|
||||||
set RET=%ERRORLEVEL%
|
set RET=%ERRORLEVEL%
|
||||||
if not %RET%==0 exit /b %RET%
|
if not %RET%==0 exit /b %RET%
|
||||||
popd
|
popd
|
||||||
) ELSE (
|
) else (
|
||||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned."
|
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned."
|
||||||
set RET=0
|
set RET=0
|
||||||
)
|
)
|
||||||
@@ -515,7 +515,7 @@ exit /b %RET%
|
|||||||
:: BuildSolution - Builds/Rebuilds/Cleans a solution using MSBuild
|
:: BuildSolution - Builds/Rebuilds/Cleans a solution using MSBuild
|
||||||
:: Params: %1 solutioName, %2 configuration
|
:: Params: %1 solutioName, %2 configuration
|
||||||
:BuildSolution
|
:BuildSolution
|
||||||
call cecho.cmd 0 13 "%BUILD_TYPE%ing %2 %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
call cecho.cmd 0 13 "Building %2 %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
||||||
%MSBUILD_CMD% %1 /p:configuration=%2;platform=%VS_PLATFORM%
|
%MSBUILD_CMD% %1 /p:configuration=%2;platform=%VS_PLATFORM%
|
||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ exit /b %RET%
|
|||||||
|
|
||||||
:: PrintUsage - Prints usage information
|
:: PrintUsage - Prints usage information
|
||||||
:PrintUsage
|
:PrintUsage
|
||||||
call %~dp0\utils\cecho.cmd 0 10 "Requirements for a successful execution:"
|
call "%~dp0\utils\cecho.cmd" 0 10 "Requirements for a successful execution:"
|
||||||
echo 1. Install PowerShell (preinstalled in Windows ^>= 7) and make sure 'powershell' is accessible from PATH.
|
echo 1. Install PowerShell (preinstalled in Windows ^>= 7) and make sure 'powershell' is accessible from PATH.
|
||||||
echo - https://support.microsoft.com/en-us/kb/968929
|
echo - https://support.microsoft.com/en-us/kb/968929
|
||||||
echo 2. Install Git and make sure 'git' is accessible from PATH.
|
echo 2. Install Git and make sure 'git' is accessible from PATH.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ goto :End
|
|||||||
|
|
||||||
:Error
|
:Error
|
||||||
echo.
|
echo.
|
||||||
call %~dp0\utils\cecho.cmd 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% build failed!"
|
call "%~dp0\utils\cecho.cmd" 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% build failed!"
|
||||||
%IFCOS_PAUSE_ON_ERROR%
|
%IFCOS_PAUSE_ON_ERROR%
|
||||||
set IFCOS_SCRIPT_RET=1
|
set IFCOS_SCRIPT_RET=1
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ goto :End
|
|||||||
|
|
||||||
:Error
|
:Error
|
||||||
echo.
|
echo.
|
||||||
call %~dp0\utils\cecho.cmd 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation failed!"
|
call "%~dp0\utils\cecho.cmd" 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation failed!"
|
||||||
%IFCOS_PAUSE_ON_ERROR%
|
%IFCOS_PAUSE_ON_ERROR%
|
||||||
set IFCOS_SCRIPT_RET=1
|
set IFCOS_SCRIPT_RET=1
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -33,7 +33,7 @@ for /f "tokens=*" %%f in ('dir BuildDepsCache-*.txt /o:-n /t:a /b') do (
|
|||||||
set GENERATOR=%1
|
set GENERATOR=%1
|
||||||
if (%1)==() (
|
if (%1)==() (
|
||||||
if not defined GEN_SHORTHAND (
|
if not defined GEN_SHORTHAND (
|
||||||
echo BuildDepsCache file does and/or GEN_SHORTHAND missing from it. Run build-deps.cmd to create it.
|
echo BuildDepsCache file does not exist and/or GEN_SHORTHAND missing from it. Run build-deps.cmd to create it.
|
||||||
set IFCOS_PAUSE_ON_ERROR=pause
|
set IFCOS_PAUSE_ON_ERROR=pause
|
||||||
goto :Error
|
goto :Error
|
||||||
)
|
)
|
||||||
@@ -59,6 +59,7 @@ IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
|
|||||||
pushd ..\%BUILD_DIR%
|
pushd ..\%BUILD_DIR%
|
||||||
|
|
||||||
set BOOST_ROOT=%DEPS_DIR%\boost
|
set BOOST_ROOT=%DEPS_DIR%\boost
|
||||||
|
REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost\boost
|
||||||
set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\vs%VS_VER%-%VS_PLATFORM%\lib
|
set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\vs%VS_VER%-%VS_PLATFORM%\lib
|
||||||
set ICU_INCLUDE_DIR=%INSTALL_DIR%\icu\include
|
set ICU_INCLUDE_DIR=%INSTALL_DIR%\icu\include
|
||||||
set ICU_LIBRARY_DIR=%INSTALL_DIR%\icu\lib
|
set ICU_LIBRARY_DIR=%INSTALL_DIR%\icu\lib
|
||||||
@@ -113,7 +114,7 @@ goto :Finish
|
|||||||
|
|
||||||
:Error
|
:Error
|
||||||
echo.
|
echo.
|
||||||
call %~dp0\utils\cecho.cmd 0 12 "An error occurred! Aborting!"
|
call "%~dp0\utils\cecho.cmd" 0 12 "An error occurred! Aborting!"
|
||||||
%IFCOS_PAUSE_ON_ERROR%
|
%IFCOS_PAUSE_ON_ERROR%
|
||||||
set IFCOS_SCRIPT_RET=1
|
set IFCOS_SCRIPT_RET=1
|
||||||
goto :Finish
|
goto :Finish
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set TARGET_ARCH=%1
|
set TARGET_ARCH=%1
|
||||||
if "%TARGET_ARCH%"=="" set TARGET_ARCH=x64
|
if "%TARGET_ARCH%"=="" set TARGET_ARCH=x64
|
||||||
if not exist %~dp0BuildDepsCache-%TARGET_ARCH%.txt. (
|
if not exist "%~dp0BuildDepsCache-%TARGET_ARCH%.txt". (
|
||||||
echo %~dp0BuildDepsCache-%TARGET_ARCH%.txt does not exist
|
echo %~dp0BuildDepsCache-%TARGET_ARCH%.txt does not exist
|
||||||
goto :EOF
|
goto :EOF
|
||||||
)
|
)
|
||||||
for /f "delims== tokens=1,2" %%G in (%~dp0BuildDepsCache-%TARGET_ARCH%.txt) do set %%G=%%H
|
for /f "delims== tokens=1,2" %%G in ("%~dp0BuildDepsCache-%TARGET_ARCH%.txt") do set %%G=%%H
|
||||||
if not defined PYTHONHOME (
|
if not defined PYTHONHOME (
|
||||||
echo PYTHONHOME PYTHONHOME not defined
|
echo PYTHONHOME not defined
|
||||||
goto :EOF
|
goto :EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user