Skip to content

Commit 05d27aa

Browse files
committed
update readme
1 parent c44377f commit 05d27aa

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,35 @@ For example, to compile and run the server example, use:
7575
make examples/server
7676
```
7777

78+
### CMake Build
79+
80+
```bash
81+
# default config (tests and examples build OFF, static library)
82+
cmake -B path/to/build_directory
83+
# or add examples and test build
84+
cmake -B path/to/build_directory -DTESTS_BUILD=ON -DEXAMPLES_BUILD=ON
85+
# build
86+
cmake --build path/to/build_directory
87+
# install
88+
cmake --install path/to/build_directory --prefix path/to/directory
89+
```
90+
91+
Add this on your cmake project
92+
93+
```cmake
94+
include(FetchContent)
95+
96+
find_package(facil.io 0.8.0)
97+
if (NOT facil.io_FOUND)
98+
FetchContent_Declare(facil.io GIT_REPOSITORY https://github.com/facil-io/cstl.git
99+
GIT_TAG master)
100+
FetchContent_GetProperties(facil.io)
101+
FetchContent_MakeAvailable(facil.io)
102+
endif()
103+
104+
target_link_libraries(${PROJECT_NAME} PRIVATE facil.io::facil.io)
105+
```
106+
78107
## Contribution Notice
79108

80109
If you're submitting a PR, make sure to update the corresponding code slice (file) in the `fio-stl` folder, the `makefile` will re-produce the `fio-stl.h` file automatically.

0 commit comments

Comments
 (0)