Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] fix format target and document usage #244

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
# Installation

## From Repository Sources

Install and use the library in your projects by cloning the repository, configuring, and installing the project on all platforms:
Download and install the [latest release package](https://github.com/FrancoisCarouge/Kalman/releases). Alternatively, you may install and use the library in your projects by cloning the repository, configuring, and installing the project:

```shell
git clone --depth 1 "https://github.com/FrancoisCarouge/Kalman.git" "kalman"
git clone --depth 1 "https://github.com/FrancoisCarouge/kalman.git"
cmake -S "kalman" -B "build"
cmake --build "build" --parallel
sudo cmake --install "build"
```

The standard shared CMake configuration file provides the library target to use in your own target:

```cmake
find_package(kalman)
target_link_libraries(your_target PRIVATE kalman::kalman)
```

In your sources, include the library header and use the filter. See [the samples](https://github.com/FrancoisCarouge/Kalman/tree/develop/sample) for more.

```cpp
#include "fcarouge/kalman.hpp"

fcarouge::kalman filter;
```

# Development Build & Run

## Tests & Samples

Build and run the tests and samples:

```shell
git clone --depth 1 "https://github.com/FrancoisCarouge/Kalman.git" "kalman"
git clone --depth 1 "https://github.com/FrancoisCarouge/kalman.git"
cmake -S "kalman" -B "build"
cmake --build "build" --config "Debug" --parallel
ctest --test-dir "build" --build-config "Debug" --tests-regex "kalman_(test|sample)" --output-on-failure --parallel
Expand All @@ -33,7 +46,7 @@ See the [Benchmark](benchmark/) section.
### Linux

```shell
git clone --depth 1 "https://github.com/FrancoisCarouge/Kalman.git" "kalman"
git clone --depth 1 "https://github.com/FrancoisCarouge/kalman.git"
cmake -S "kalman" -B "build"
cmake --build "build" --target "package" --parallel
cmake --build "build" --target "package_source" --parallel
Expand All @@ -42,7 +55,7 @@ cmake --build "build" --target "package_source" --parallel
### Windows

```shell
git clone --depth 1 "https://github.com/FrancoisCarouge/Kalman.git" "kalman"
git clone --depth 1 "https://github.com/FrancoisCarouge/kalman.git"
cmake -S "kalman" -B "build"
cmake --build "build" --target "package" --parallel --config "Release"
cmake --build "build" --target "package_source" --parallel --config "Release"
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,17 @@ filter.update(position_x, position_y, variometer);
# Installation

```shell
git clone --depth 1 https://github.com/FrancoisCarouge/Kalman.git "kalman"
git clone --depth 1 https://github.com/FrancoisCarouge/kalman.git
cmake -S "kalman" -B "build"
cmake --build "build" --parallel
sudo cmake --install "build"
```

```cmake
find_package(kalman)
target_link_libraries(your_target PRIVATE kalman::kalman)
```

[For more, see installation instructions](INSTALL.md).

# Reference
Expand Down
3 changes: 2 additions & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ target_sources(
"fcarouge/kalman.hpp")
target_compile_options(kalman INTERFACE ${OPTIONS})
target_compile_features(kalman INTERFACE cxx_std_23)
target_link_libraries(kalman INTERFACE $<$<NOT:$<BOOL:${WIN32}>>:kalman_format>)
target_link_libraries(
kalman INTERFACE $<BUILD_INTERFACE:$<$<NOT:$<BOOL:${WIN32}>>:kalman_format>>)
install(
TARGETS kalman
EXPORT kalmanTargets
Expand Down
3 changes: 1 addition & 2 deletions support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ else()
TARGETS kalman_format
EXPORT kalmanTargets
FILE_SET "kalman_format_headers"
DESTINATION "include/fcarouge"
ARCHIVE DESTINATION "lib/fcarouge")
DESTINATION "include/fcarouge")
install(
EXPORT kalmanTargets
NAMESPACE kalman::
Expand Down