0028787: Configuration, genproj - add option HAVE_RelWithDebInfo for generating VS...
[occt.git] / dox / dev_guides / building / msvc.md
CommitLineData
ba06f8bb 1Building with MS Visual C++ {#occt_dev_guides__building_msvc}
72b7576f 2===========================
3
72c37458 4@tableofcontents
72b7576f 5
72c37458 6@section build_msvc_intro General
72b7576f 7
72c37458 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).
72b7576f 10
72c37458 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.
72b7576f 13
72c37458 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**.
72b7576f 16
72c37458 17@section build_msvc_3rdparty Third-party libraries
72b7576f 18
72c37458 19Before building OCCT, make sure to have all the required third-party libraries installed.
72b7576f 20
72c37458 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 http://www.opencascade.com/content/3rd-party-components.
72b7576f 22
72c37458 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* -- version of Visual Studio (vc10, vc11, vc12, or vc14), and relevant *VCVARS* path
30* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
31* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
32* <i>CSF_OPT_*</i> -- paths to search for includes and binaries of all used third-party products
5951a088 33* *SHORTCUT_HEADERS* -- defines method for population of folder *inc* by header files. Supported methods are:
34 * *Copy* - headers will be copied from *src*;
35 * *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
36 * "HardLink* - hard links to headers located in *src* will be created.
72c37458 37
38Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
39That tool will analyze your environment and propose you to choose available options:
40
26cfd29c 41* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
5951a088 42* Method to populate folder *inc* (short-cuts by default).
72c37458 43* Location of third-party libraries (usually downloaded from OCCT web site, see above).
26cfd29c 44* Path to common directory where third-party libraries are located (optional).
72c37458 45* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
26cfd29c 46* Generation of PDB files within Release build ("Release with Debug info", false by default).
72c37458 47
48@figure{/dev_guides/building/3rdparty/images/genconf_windows.png}
49
50Click "Save" to store the specified configuration in *custom.bat* file.
51
52@section build_msvc_generate Projects generation
53
54Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
55
56@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
57If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
58
59~~~~~
60 $ genproj.bat
61~~~~~
62
63Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
64
65@section build_msvc_build Building
66
67Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
68
69Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
70Binaries are produced in *win32* or *win64* folders.
39080842 71
576f8b11 72To start DRAW, launch *draw.bat*.