Skip to content

Commit

Permalink
Merge pull request #1467 from contour-terminal/fix/cmake_release_presets
Browse files Browse the repository at this point in the history
Update presets to handle build type and directories for release correctly
  • Loading branch information
christianparpart committed Feb 13, 2024
2 parents 926e31f + cb9f616 commit 826b623
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ can be insalled via the system package manager.

#### Compile

You can use cmake presets to compile contour. The full list of available presets can be seen using `cmake --list-presets`. To compile release build for linux or MacOs use `linux-release` or `macos-release` accordingly. FreeBSD users can use `linux-release` or configure cmake manually.

```sh
cmake -S . -B build -G Ninja
cmake --build build/
cmake --preset linux-release
cmake --build --preset linux-release

# Optionally, if you want to install from source
cmake --build build/ --target install
cmake --build --preset linux-release --target install
```

#### Windows 10 or newer
Expand Down
4 changes: 2 additions & 2 deletions cmake/presets/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"description": "Common settings for all configurations",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CONTOUR_INSTALL_TOOLS": "ON",
"CONTOUR_TESTING": "ON",
"LIBTERMINAL_BUILD_BENCH_HEADLESS": "ON",
Expand All @@ -27,7 +26,8 @@
"name": "debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
}
}
]
Expand Down
15 changes: 10 additions & 5 deletions cmake/presets/os-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
}
},
{
"name": "linux-common-release",
"hidden": true,
"inherits": "release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_INSTALL_PREFIX": "/usr/local"
}
},
{
Expand All @@ -35,7 +40,7 @@
{
"name": "linux-release",
"displayName": "Linux 64-bit",
"inherits": ["linux-common", "release"]
"inherits": ["linux-common", "linux-common-release"]
},
{
"name": "linux-debug",
Expand All @@ -45,7 +50,7 @@
{
"name": "linux-clang-release",
"displayName": "Linux 64-bit (Clang)",
"inherits": ["linux-clang", "release"]
"inherits": ["linux-clang", "linux-common-release"]
},
{
"name": "linux-clang-debug",
Expand All @@ -55,7 +60,7 @@
{
"name": "linux-gcc-release",
"displayName": "Linux 64-bit (GCC)",
"inherits": ["linux-gcc", "release"]
"inherits": ["linux-gcc", "linux-common-release"]
},
{
"name": "linux-gcc-debug",
Expand Down
8 changes: 5 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ can be insalled via the system package manager.

#### Compile

You can use cmake presets to compile contour. The full list of available presets can be seen using `cmake --list-presets`. To compile release build for linux or MacOs use `linux-release` or `macos-release` accordingly. FreeBSD users can use `linux-release` or configure cmake manually.

```sh
cmake -S . -B build -G Ninja
cmake --build build/
cmake --preset linux-release
cmake --build --preset linux-release

# Optionally, if you want to install from source
cmake --build build/ --target install
cmake --build --preset linux-release --target install
```

Please mind, if you want to install into a system root, e.g. `/usr/local`, you may need to prefix
Expand Down

0 comments on commit 826b623

Please sign in to comment.