0031366: Documentation - Doxygen warnings in Standard_Dump.hxx
[occt.git] / dox / dev_guides / building / msvc.md
... / ...
CommitLineData
1Building with MS Visual C++ {#occt_dev_guides__building_msvc}
2===========================
3
4@tableofcontents
5
6@section build_msvc_intro General
7
8This page describes steps to build OCCT libraries from a complete source archive on Windows with <b>MS Visual C++</b> using projects generated by **genproj** tool.
9It is an alternative to use of CMake build system (see @ref occt_dev_guides__building_cmake).
10
11**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code.Blocks, and XCode project files used for building Open CASCADE Technology.
12These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
13
14The project files included in official distribution of OCCT are generated by this tool.
15If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
16
17@section build_msvc_3rdparty Third-party libraries
18
19Before building OCCT, make sure to have all the required third-party libraries installed.
20
21The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from https://www.opencascade.com/content/3rd-party-components.
22
23You can also build third-party libraries from their sources, see @ref occt_dev_guides__building_3rdparty_windows for instructions.
24
25@section build_msvc_conf Configuration
26
27If you have Visual Studio projects already available (pre-installed or generated), you can edit file *custom.bat* manually to adjust the environment:
28
29* *VCVER* -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
30
31| VCVER | Visual Studio version | Windows Platform | Binaries folder name |
32|-----------|-----------------------|----------------------------------|----------------------|
33| vc10 | 2010 (10) | Desktop (Windows API) | vc10 |
34| vc11 | 2012 (11) | Desktop (Windows API) | vc11 |
35| vc12 | 2013 (12) | Desktop (Windows API) | vc12 |
36| vc14 | 2015 (14) | Desktop (Windows API) | vc14 |
37| vc14-uwp | 2015 (14) | UWP (Universal Windows Platform) | vc14-uwp |
38| vc141 | 2017 (15) | Desktop (Windows API) | vc14 |
39| vc141-uwp | 2017 (15) | UWP (Universal Windows Platform) | vc14-uwp |
40| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
41| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
42
43* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
44* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
45* <i>CSF_OPT_*</i> -- paths to search for includes and binaries of all used third-party products
46* *SHORTCUT_HEADERS* -- defines method for population of folder *inc* by header files. Supported methods are:
47 * *Copy* - headers will be copied from *src*;
48 * *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
49 * "HardLink* - hard links to headers located in *src* will be created.
50
51Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
52That tool will analyze your environment and propose you to choose available options:
53
54* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
55* Method to populate folder *inc* (short-cuts by default).
56* Location of third-party libraries (usually downloaded from OCCT web site, see above).
57* Path to common directory where third-party libraries are located (optional).
58* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
59* Generation of PDB files within Release build ("Release with Debug info", false by default).
60
61@figure{/dev_guides/building/3rdparty/images/genconf_windows.png}
62
63Click "Save" to store the specified configuration in *custom.bat* file.
64
65@section build_msvc_generate Projects generation
66
67Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
68
69@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
70If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
71
72~~~~~
73 $ genproj.bat
74~~~~~
75
76Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
77
78@section build_msvc_build Building
79
80Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
81
82Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
83Binaries are produced in *win32* or *win64* folders.
84
85To start DRAW, launch *draw.bat*.