Skip to content

Commit

Permalink
📝 Add CPM & add_subdirectory install instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff authored Aug 29, 2021
1 parent fa53da0 commit c94ac30
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@

`QOlm` is based on `QAbstractListModel`, and behave as a list of custom `QObject`. `QOlmBase` is detail implementation to provide `signals` and `slots` that `moc` can handle. Since `moc` isn't working with template class.

### 🔨 Build and execute.
### 🔨 Build and integrate

- `QOlm` is the main target. It has an alias `QOlm::QOlm`.
- It come with unit tests `QOlm_Tests`
- It come with examples `QOlm_Examples`

#### CMake super build
#### CMake add_subdirectory

Copy QOlm source in your project, and simply call `add_subdirectory` to enable `QOlm::QOlm` target

```cmake
add_subdirectory(path/to/qolm-src)
target_link_libraries(MyTarget PRIVATE QOlm::QOlm)
```

#### CMake FetchContent

Add the following code snippet to your `CMakelists.txt`. This will download and build QOlm with `MyTarget`.

Expand All @@ -41,6 +50,20 @@ FetchContent_MakeAvailable(QOlm)
target_link_libraries(MyTarget PRIVATE QOlm::QOlm)
```

#### CPM.cmake

Include QOlm with [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake). `CMake 3.14` is required because CPM use `FetchContent` under the hood.

```cmake
include(cmake/CPM.cmake)
CPMAddPackage(
NAME QOlm
GIT_REPOSITORY "https://github.com/OlivierLDff/QOlm"
GIT_TAG "master"
)
target_link_libraries(MyTarget PRIVATE QOlm::QOlm)
```

#### 📦️ Install

`QOlm` can be installed with:
Expand Down

0 comments on commit c94ac30

Please sign in to comment.