# difference between cmake --build . -- install and cmake --build . followed by cmake --install . ?

**URL:** https://discourse.cmake.org/t/difference-between-cmake-build-install-and-cmake-build-followed-by-cmake-install/10114
**Category:** Usage
**Created:** [February 16, 2024, 12:46pm UTC](https://discourse.cmake.org/t/difference-between-cmake-build-install-and-cmake-build-followed-by-cmake-install/10114 "2024-02-16T12:46:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [February 16, 2024, 12:46pm UTC](https://discourse.cmake.org/t/difference-between-cmake-build-install-and-cmake-build-followed-by-cmake-install/10114/1 "2024-02-16T12:46:48Z")

</div>

Hi,

I think everything is in the title.

To had a bit of context, so far I was using makefiles generators (linux, nmake, or mingw) then called `make install` to build and install (or `nmake`, or `mingw32-make`). In order to have less boilerplate code in my compilation framework, I would like to take benefit of the `cmake` cli. Thus I was wondering if `xxxmake install` was the same thing as `cmake --build . -- install`.

Regards

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [February 16, 2024, 5:25pm UTC](https://discourse.cmake.org/t/difference-between-cmake-build-install-and-cmake-build-followed-by-cmake-install/10114/2 "2024-02-16T17:25:07Z")

</div>

Yes I have successfully encouraged colleagues and users to do like:

```sh
cmake -B build
cmake --build build # instead of "make"
cmake --install build # instead of "make install"

```

Users can set a default number of parallel build threads (handy for make) by setting in ~/.profile or similar on Unix-like systems

```sh
export CMAKE_BUILD_PARALLEL_LEVEL= 
# Linux: $(nproc)
# macOS: $(sysctl -n hw.physicalcpu)

```

Likewise on Windows I set environment variable like

```sh
CMAKE_BUILD_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%

```

Then you don’t need to use the `cmake --build build --parallel` option, it’s build in parallel by default like Ninja.
