Skip to content

Commit 7cf636b

Browse files
authored
Update README.md
1 parent 49b836b commit 7cf636b

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,15 @@ Comparative performance results against rxcpp and folly (tested on 2025-06-14):
9393
- **Compiler**: C++20 compatible (GCC 10+, Clang 12+, MSVC 19.30+)
9494
- **Build System**: CMake 3.15+
9595

96+
可以在你原有的 README 或安装说明里,补充一个 **vcpkg 安装和使用方式**,并说明与系统安装的区别。比如这样写:
97+
98+
---
99+
96100
## 🛠 Installation
97101

98-
To build and install the `reaction` reactive framework, follow the steps below:
102+
### 1. From source (manual installation)
103+
104+
To build and install the `reaction` reactive framework manually:
99105

100106
```bash
101107
git clone https://github.com/lumia431/reaction.git && cd reaction
@@ -107,6 +113,40 @@ After installation, you can include and link against reaction in your own CMake-
107113

108114
```cmake
109115
find_package(reaction REQUIRED)
116+
target_link_libraries(your_target PRIVATE reaction)
117+
```
118+
119+
---
120+
121+
### 2. Using vcpkg (recommended)
122+
123+
You can also install `reaction` via **vcpkg**, which handles dependencies and CMake integration automatically.
124+
125+
1. **Install reaction via vcpkg**:
126+
127+
```bash
128+
cd /path/to/vcpkg
129+
./vcpkg install reaction
130+
```
131+
132+
2. **Integrate vcpkg with your CMake project**:
133+
134+
When configuring your project, specify the vcpkg toolchain file:
135+
136+
```bash
137+
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
138+
cmake --build build
139+
```
140+
141+
3. **Use reaction in your CMakeLists.txt**:
142+
143+
```cmake
144+
find_package(reaction CONFIG REQUIRED)
145+
146+
add_executable(my_app main.cpp)
147+
148+
# Link against the vcpkg-provided target
149+
target_link_libraries(my_app PRIVATE reaction::reaction)
110150
```
111151

112152
### Uninstall
@@ -529,4 +569,4 @@ We welcome all forms of contributions to make **Reaction** even better:
529569
git clone https://github.com/lumia431/reaction.git
530570
cd reaction
531571
# Create a feature branch (feat/xxx or fix/xxx)
532-
# Submit PR against `dev` branch
572+
# Submit PR against `dev` branch

0 commit comments

Comments
 (0)