Skip to content

Commit a451f89

Browse files
Add cmake install
1 parent cebf8f6 commit a451f89

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
*build*
3+
install
34
docs

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"-DCPP_CHANNEL_BUILD_TESTS=ON",
55
"-DCPP_CHANNEL_COVERAGE=ON",
66
"-DCPP_CHANNEL_SANITIZERS=ON",
7-
"-DCMAKE_CXX_STANDARD=11"
7+
"-DCMAKE_CXX_STANDARD=11",
8+
"-DCMAKE_INSTALL_PREFIX=${workspaceFolder}/install",
89
],
910
"clang-tidy.fixOnSave": false,
1011
"clang-tidy.lintOnSave": false,

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ endif()
2727
if (CPP_CHANNEL_BUILD_EXAMPLES)
2828
add_subdirectory(examples)
2929
endif()
30+
31+
install(DIRECTORY include/ DESTINATION include)

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@
2020

2121
## Installation
2222

23+
Choose one of the methods:
24+
2325
* Copy the [include](https://github.com/andreiavrammsd/cpp-channel/tree/master/include) directory into your project and add it to your include path.
24-
* With [CMake](https://github.com/andreiavrammsd/cpp-channel/tree/master/examples/cmake-project)
25-
* With [Bazel](https://github.com/andreiavrammsd/cpp-channel/tree/master/examples/bazel-project)
26+
* [CMake FetchContent](https://github.com/andreiavrammsd/cpp-channel/tree/master/examples/cmake-project)
27+
* [CMake install](https://cmake.org/cmake/help/latest/command/install.html)
28+
```shell
29+
VERSION=1.0.0 \
30+
&& wget https://github.com/andreiavrammsd/cpp-channel/archive/refs/tags/v$VERSION.zip \
31+
&& unzip v$VERSION.zip \
32+
&& cd cpp-channel-$VERSION \
33+
&& mkdir build && cd build \
34+
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local \
35+
&& sudo cmake --install .
36+
```
37+
* [Bazel](https://github.com/andreiavrammsd/cpp-channel/tree/master/examples/bazel-project)
2638

2739
## Usage
2840

0 commit comments

Comments
 (0)