User:Legoboyvdlp/Building using CMake - Windows: Difference between revisions

Line 70: Line 70:


=== GUI compilation ===
=== GUI compilation ===
# Set up a work directory as described above.
# Set up a work directory as described above or to your own personal preference.
# Having downloaded the sources into the Source directory, and all the prebuilt dependencies, continue below:
# '''Building SimGear'''
# '''Building SimGear'''
## Open the CMake gui.
## Open the CMake gui.
## Set <tt>"Where is the source code"</tt> to wherever you put the SimGear sources (from the released tarball or the git repository).
## Set <tt>"Where is the source code"</tt> to the Source/simgear-git directory.
## Set <tt>"Where to build the binaries"</tt> to a new empty directory (could be anywhere and any name, for example naming it simgear-build, at the same folder location as your unzipped SimGear source folder was put).
## Set <tt>"Where to build the binaries"</tt> to the empty directory <tt>simgear-build</tt> in the BuildDirs directory.
## Press [[File:CMake GUI Configure.png]]. The first time that the project is configured, CMake will bring up a window asking you to "Specify the generator for this project" i.e. which compiler you wish to use. Select Visual Studio 14 2015 (or Visual Studio 14 2015 Win64 for 64-bit), and press Finish. CMake will now do a check on your system and will produce a preliminary build configuration.
## Press [[File:CMake GUI Configure.png]]. The first time that the project is configured, CMake will bring up a window asking you to "Specify the generator for this project" i.e. which compiler you wish to use. Select Visual Studio 16 2019 (or the respective version for your own copy of Visual Studio), and press Finish. CMake will now do a check on your system and will produce a preliminary build configuration.
## CMake adds new configuration variables in red. Some have a value ending with <tt>-NOTFOUND</tt>. These variables should receive your attention. Some errors will prevent SimGear from building and others will simply invalidate some options without causing build errors.  
## CMake adds new configuration variables in red. Some have a value ending with <tt>-NOTFOUND</tt>. These variables should receive your attention. Some errors will prevent SimGear from building and others will simply invalidate some options without causing build errors.  
### First check the <tt>MSVC_3RDPARTY_ROOT</tt> variable. If it is not set, chances are that there will be a lot of <tt>-NOTFOUND</tt> errors. Instead of trying to fix every error individually, set that variable to the location of the directory structure that is presented above. Then press [[File:CMake GUI Configure.png]] again.
### First check the <tt>MSVC_3RDPARTY_ROOT</tt> variable. If it is not set, chances are that there will be a lot of <tt>-NOTFOUND</tt> errors. Instead of trying to fix every error individually, set that variable to the location of the Dependencies foldier in the directory structure that is presented above. Then press [[File:CMake GUI Configure.png]] again.
### Set the  <tt>CMAKE_INSTALL_PREFIX</tt> variable to <tt>${MSVC_3RDPARTY_ROOT}/install/msvc140/SimGear</tt> (<tt>msvc140-64</tt> for 64-bit).
### Set the  <tt>CMAKE_INSTALL_PREFIX</tt> variable to <tt>${MSVC_3RDPARTY_ROOT}/install/msvc140/SimGear</tt> (<tt>msvc140-64</tt> for 64-bit).
### Also check the lines with a checkbox. These are build options and may impact the feature set of the built program.
### Also check the lines with a checkbox. These are build options and may impact the feature set of the built program.
842

edits