0032315: Configuration, CMake - fix building Draw Harness plugins as static libraries
[occt.git] / adm / scripts / cmake_gen.bat
1 @echo off
2
3 rem Auxiliary script for semi-automated building of OCCT using cmake.
4 rem cmake_custom.bat should be configured with VS version and path to 3rd-parties.
5 rem OCCT3RDPARTY must be specified as mandatory dependency.
6
7 setlocal
8
9 set "SrcRoot=%~dp0..\.."
10
11 set VS=14
12 set VSDATA=2015
13 set VSPLATFORM=Win64
14 set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
15 set "OCCT3RDPARTY="
16 set "INSTALL_DIR=%SrcRoot%\install"
17
18 set BUILD_ADDITIONAL_TOOLKITS=
19 set BUILD_DOC_Overview=OFF
20 set BUILD_Inspector=OFF
21 set BUILD_LIBRARY_TYPE=Shared
22 set BUILD_PATCH=
23 set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
24 set BUILD_WITH_DEBUG=OFF
25 set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
26 set BUILD_USE_PCH=OFF
27
28 set BUILD_MODULE_ApplicationFramework=ON
29 set BUILD_MODULE_DataExchange=ON
30 set BUILD_MODULE_Draw=ON
31 set BUILD_MODULE_ModelingAlgorithms=ON
32 set BUILD_MODULE_ModelingData=ON
33 set BUILD_MODULE_Visualization=ON
34
35 set USE_D3D=OFF
36 set USE_FFMPEG=OFF
37 set USE_FREEIMAGE=OFF
38 set USE_GLES2=OFF
39 set USE_RAPIDJSON=OFF
40 set USE_TBB=OFF
41 set USE_VTK=OFF
42
43 if exist "%~dp0cmake_custom.bat" call "%~dp0cmake_custom.bat"
44
45 if not "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA% %VSPLATFORM%"
46 if     "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA%"
47
48 set "INSTALL_DIR=%INSTALL_DIR:\=/%"
49 set "OCCT3RDPARTY=%OCCT3RDPARTY:\=/%"
50
51 set "BUILD_DIR=%SrcRoot%\%BUILD_DIR%"
52 if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
53 pushd "%BUILD_DIR%"
54  
55 cmake -G "%arch_compile%" ^
56   -D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
57   -D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
58   -D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
59   -D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
60   -D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
61   -D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
62   -D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
63   -D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
64   -D BUILD_MODULE_FoundationClasses:BOOL=ON ^
65   -D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
66   -D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
67   -D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
68   -D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
69   -D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
70   -D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
71   -D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
72   -D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
73   -D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
74   -D USE_D3D:BOOL=%USE_D3D% ^
75   -D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
76   -D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
77   -D USE_GLES2:BOOL=%USE_GLES2% ^
78   -D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
79   -D USE_TBB:BOOL=%USE_TBB% ^
80   -D USE_VTK:BOOL=%USE_VTK% ^
81   "%SrcRoot%"
82
83 popd
84 endlocal