Mention CMake suport in Visual Studio 2017

This commit is contained in:
Eugene Shalygin 2017-03-15 13:54:57 +01:00
parent 5141563ecd
commit 9a9a306d5a

View File

@ -13,7 +13,7 @@ Things will be easier if you install all the dependencies into the same prefix,
CMake encourage you to use so called out-of-source builds (i.e. build into a different directory than the one with source files). In fact, CMake does not even provide a "clean" command to remove generated files --- you simply delete the build directory (do not confuse with a "clean" command of the build system, which removes files, generatad during a build, this CMake does provide). You may have different build directories, configured with options (see below). And, of course, you do not pollute your sources, that are always ready for <code>git diff</code>.
== Configuring and generating build files ==
CMake does not build a project by itself. Instead it generates rules for an actual build software. These generators include traditional makefiles as well as other platform-specific (like XCode or Visual Studio) or not (Ninja) build tools. At the same time CMake projects can be integrated with IDEs. This is done in two ways: either CMake generates project files, which include call to CMake itself to update those files if needed, or an IDE may load CMake project structure directly. The generators for Visual Studio and XCode implement the former approach, while Qt Creator and KDevelop use the latter model. Before continuing you have to decide which generator you will use and will you integrate with an IDE or not. You may get a list of available generators running <code>cmake -G</code> or <code>cmake --help</code>
CMake does not build a project by itself. Instead it generates rules for an actual build software. These generators include traditional makefiles as well as other platform-specific (like XCode or Visual Studio) or not (Ninja) build tools. At the same time CMake projects can be integrated with IDEs. This is done in two ways: either CMake generates project files, which include call to CMake itself to update those files if needed, or an IDE may load CMake project structure directly. The generators for Visual Studio and XCode implement the former approach, while Qt Creator, KDevelop and Visual Studio 2017 use the latter model. Before continuing you have to decide which generator you will use and will you integrate with an IDE or not. You may get a list of available generators running <code>cmake -G</code> or <code>cmake --help</code>
=== IDE Support ===
;Qt Creator
: This IDE can just open the top-level project <code>CMakeLists.txt</code> file and load the project structure. Then it will ask you where to put build files and which make tool to use. Please note that Ninja will give you significantly shorter rebuild times, as comparing to a regular make. From version 4.3 of Qt Creator and 3.7 of CMake, support is excellent (see this [http://blog.qt.io/blog/2016/11/15/cmake-support-in-qt-creator-and-elsewhere/ blog post] for details).
@ -22,7 +22,7 @@ CMake does not build a project by itself. Instead it generates rules for an actu
;XCode
: You have to use "XCode" generator to generate project files. Then when any of the CMake project files get updated, the next build command will re-generate the XCode projects and XCode will reload them.
;Visual Studio
: You have to use "Visual Studio" generator to generate project files. Then when any of the CMake project files get updated, the next build command will re-generate the projects files and Visual Studio will ask to reload them.
: Full integration from 2017 version, otherwise you have to use "Visual Studio" generator to generate project files. Then when any of the CMake project files get updated, the next build command will re-generate the projects files and Visual Studio will ask to reload them.
With the generator selected, you have to do one of the following:
;No IDE
@ -32,7 +32,7 @@ With the generator selected, you have to do one of the following:
;Visual Studio
: Create build directory. This directory will contain Visual Studio project files as well. Cd into that directory and issue a command:
: <code>cmake -G "Visual Studio xxxx" -D<option1> -D<option2> <source directory></code>. If your build directory is as above (<code>build/debug</code>), the command may be:
: <code>cmake -G "Visual Studio 2015" -DQT5=ON -DSYSTEM_QTSINGLEAPPLICATION=ON ../..</code>. For the list of supported by qBittorrent and CMake options (and where to look them up) see below.
: <code>cmake -G "Visual Studio 2015" -DSYSTEM_QTSINGLEAPPLICATION=ON ../..</code>. For the list of supported by qBittorrent and CMake options (and where to look them up) see below.
;XCode
: Same as for Visual Studio, replace generator with "XCode".
;KDevelop, Qt Creator