MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #27960 All Revisions ] Back to Issue ]
Summary 0027960: Configuration - fix compilation of OSD_Directory with MinGW-w64
Revision 2016-10-13 20:25 by kgv
Steps To Reproduce
@echo OFF

set "aCasSrc=%~dp0"
set aNbJobs=%NUMBER_OF_PROCESSORS%

call c:\TDM-GCC-64\mingwvars.bat
set "PATH=c:\CMake\bin;%PATH%"
set "aFreeType=c:/3rdparty-mingw64/freetype-2.6.3-mingw-64"
set "aFreeImage=c:/3rdparty-mingw64/freeimage-3.17-0-mingw-64"
set "aTclTk=C:/3rdparty-mingw64/tcltk-8.6.4-mingw-64"

call :cmakeGenerate
pause

goto :eof

:cmakeGenerate
set "aPlatformAndCompiler=mingw64"
set "aWorkDir=work\%aPlatformAndCompiler%-make"
set "aLogFile=%~dp0build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if     exist "%aLogFile%" ( del   "%aLogFile%" )

pushd "%aWorkDir%"

set STARTTIME=%TIME%
echo Configuring OCCT for %aPlatformAndCompiler%...
cmake -G "MinGW Makefiles" ^
 -D CMAKE_BUILD_TYPE:STRING="Release" ^
 -D BUILD_LIBRARY_TYPE:STRING="Shared" ^
 -D INSTALL_DIR:PATH="%~dp0work/%aPlatformAndCompiler%" ^
 -D INSTALL_DIR_INCLUDE:STRING="inc" ^
 -D INSTALL_DIR_LIB:STRING="libs/%anAbi%" ^
 -D INSTALL_DIR_RESOURCE:STRING="src" ^
 -D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
 -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
 -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
 -D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/lib" ^
 -D 3RDPARTY_FREEIMAGE_DIR:PATH="%aFreeImage%" ^
 -D 3RDPARTY_FREEIMAGE_DLL:FILEPATH="%aFreeImage%/bin/FreeImage.dll" ^
 -D 3RDPARTY_FREEIMAGE_DLL_DIR:PATH="%aFreeImage%/bin" ^
 -D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:PATH="%aFreeImage%/include" ^
 -D 3RDPARTY_FREEIMAGE_LIBRARY:FILEPATH="%aFreeImage%/lib/libFreeImage.a" ^
 -D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="%aFreeImage%/lib" ^
 -D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
 -D 3RDPARTY_TCL_DLL:FILEPATH="%aTclTk%/bin/tcl86.dll" ^
 -D 3RDPARTY_TCL_DLL_DIR:FILEPATH="%aTclTk%/bin" ^
 -D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
 -D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTclTk%/lib/libtcl86.a" ^
 -D 3RDPARTY_TCL_LIBRARY_DIR:FILEPATH="%aTclTk%/lib" ^
 -D 3RDPARTY_TK_DIR:PATH="%aTclTk%" ^
 -D 3RDPARTY_TK_DLL:FILEPATH="%aTclTk%/bin/tk86.dll" ^
 -D 3RDPARTY_TK_DLL_DIR:FILEPATH="%aTclTk%/bin" ^
 -D 3RDPARTY_TK_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
 -D 3RDPARTY_TK_LIBRARY:FILEPATH="%aTclTk%/lib/libtk86.a" ^
 -D 3RDPARTY_TK_LIBRARY_DIR:FILEPATH="%aTclTk%/lib" ^
 "%aCasSrc%"

if errorlevel 1 (
  popd
  pause
  exit /B
  goto :eof
)

mingw32-make clean

echo Building OCCT...
mingw32-make -j %aNbJobs% 2>> %aLogFile%
type %aLogFile%
if errorlevel 1 (
  popd
  pause
  exit /B
  goto :eof
)
echo Installing OCCT into %~dp0work/%aPlatformAndCompiler%...
mingw32-make install 2>> %aLogFile%

set ENDTIME=%TIME%
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%STARTTIME:~0,1%"==" " set "STARTTIME=%STARTTIME:~1%"
if   "%ENDTIME:~0,1%"==" " set   "ENDTIME=%ENDTIME:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%STARTTIME:~1,1%"==":" set "STARTTIME=0%STARTTIME%"
if   "%ENDTIME:~1,1%"==":" set   "ENDTIME=0%ENDTIME%"
rem convert hours:minutes:seconds:ms into duration
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 
+ (1%STARTTIME:~9,2%-100)
set /A   ENDTIME=  (1%ENDTIME:~0,2%-100)*360000 +   (1%ENDTIME:~3,2%-100)*6000 +   (1%ENDTIME:~6,2%-100)*100 
+   (1%ENDTIME:~9,2%-100)
set /A DURATION=%ENDTIME%-%STARTTIME%
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME%
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% for %anAbi%
echo Building time: %DURATIONH%:%DURATIONM%:%DURATIONS% >> %aLogFile%

popd
goto :eof
Revision 2016-10-13 14:50 by BenjaminBihler
Steps To Reproduce


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker