Update CMake usage in README build instructions
authorNeroBurner <pyro4hell@gmail.com>
Sun, 23 Oct 2022 19:45:16 +0000 (21:45 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Tue, 25 Oct 2022 07:50:14 +0000 (09:50 +0200)
CMake 3.14.0 released in March 2019 [1] added the command line config options
`-S <source-dir>` and `-B <build-dir>` and the build argument `--build <build-dir>` [2].
These options are universally valid independent of the build system used (`make`,
`nmake`, `ninja`, `MSBuild`,...), making the provided CMake commands more generic.

As reference Ubuntu 20.04 ships the CMake 3.16.3 [3] version.

- [1] https://gitlab.kitware.com/cmake/cmake/-/tags/v3.14.0
- [2] https://cmake.org/cmake/help/v3.14/release/3.14.html#command-line
- [3] https://packages.ubuntu.com/focal/cmake

Signed-off-by: NeroBurner <pyro4hell@gmail.com>
README.md

index 06b300e4c86bf88c0c506d0ee009eafcb8586716..38cb45c156e9fb98681b173b16801d17a80f46cb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,12 +15,10 @@ with your computer.
 
 #### :memo: Step by step instructions
 
-##### Clone the repo and create build directory
+##### Clone the repo
 ```
 $ git clone https://github.com/nextcloud/desktop.git
 $ cd desktop
-$ mkdir build
-$ cd build
 ```
 ##### Compile and install
 
@@ -33,14 +31,14 @@ $ cd build
 ##### Linux & Mac OS
 
 ```
-$ cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
-$ make install
+$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
+$ cmake --build build --target install
 ```
 
 ##### Windows
 
 ```
-$ cmake -G "Visual Studio 15 2017 Win64" .. -DCMAKE_INSTALL_PREFIX=$USERPROFILE\nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
+$ cmake -S . -B build -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=$USERPROFILE\nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
 $ cmake --build . --config Debug --target install
 ```