0027478: Configuration - avoid inclusion of Xlib.h within Graphic3d_GraphicDriver.hxx
[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
33* *SHORTCUT_HEADERS* -- if set to "true", folder *inc* will be populated by short-cut files pointing to actual headers located in *src*; otherwise, header files will be copied to *inc*.
34
35Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
36That tool will analyze your environment and propose you to choose available options:
37
38* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*)
39* Option to use short-cuts to header files in folder *inc* (enabled by default).
40* Location of third-party libraries (usually downloaded from OCCT web site, see above).
41* Path to common directory where third-party libraries are located (optional)
42* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
43
44@figure{/dev_guides/building/3rdparty/images/genconf_windows.png}
45
46Click "Save" to store the specified configuration in *custom.bat* file.
47
48@section build_msvc_generate Projects generation
49
50Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
51
52@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
53If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
54
55~~~~~
56 $ genproj.bat
57~~~~~
58
59Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
60
61@section build_msvc_build Building
62
63Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
64
65Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
66Binaries are produced in *win32* or *win64* folders.
39080842 67
576f8b11 68To start DRAW, launch *draw.bat*.