Skip to content

Commit c932813

Browse files
authored
Merge pull request #1423 from lukaszstolarczuk/fetch-content-readme
Add CMake integration steps and all devs' deps to README
2 parents aef977f + 3aeb7c0 commit c932813

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ For development and contributions:
3737
- cmake-format-0.6 (can be installed with `python -m pip install cmake-format==0.6.13`)
3838
- black (can be installed with `python -m pip install black==24.3.0`)
3939

40+
> **Note**: All devs dependencies are defined in `third-party/requirements.txt`
41+
> and can be installed, for example: `pip install -r third_party/requirements.txt`.
42+
4043
For building tests and multithreaded benchmarks:
4144

4245
- C++ compiler with C++17 support
@@ -398,6 +401,27 @@ an issue or a Pull Request, please read [Contribution Guide](./CONTRIBUTING.md).
398401
To enable logging in UMF source files please follow the guide in the
399402
[web documentation](https://oneapi-src.github.io/unified-memory-framework/introduction.html#logging).
400403

404+
## CMake integration
405+
406+
Integration of UMF into another project via CMake's
407+
[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html),
408+
is possible with:
409+
410+
```cmake
411+
include(FetchContent)
412+
413+
FetchContent_Declare(
414+
unified-memory-framework
415+
GIT_REPOSITORY https://github.com/oneapi-src/unified-memory-framework.git
416+
GIT_TAG main # This will pull the latest (potentially unstable) changes from the main branch
417+
)
418+
FetchContent_MakeAvailable(unified-memory-framework)
419+
420+
add_executable(some_example some_example.cpp)
421+
target_include_directories(some_example PRIVATE ${unified-memory-framework_SOURCE_DIR}/include)
422+
target_link_libraries(some_example PRIVATE umf::umf umf::headers)
423+
```
424+
401425
## Notices
402426

403427
The contents of this repository may have been developed with support from one or more Intel-operated generative artificial intelligence solutions.

third_party/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Python requirements modules
22
# Formatting the source code
3-
bandit==1.8.6
43
black==24.3.0
54
clang-format==15.0.7
65
cmake-format==0.6.13
6+
# Linting the source code
7+
bandit==1.8.6
78
# Tests
89
packaging==25.0
910
# Generating HTML documentation

0 commit comments

Comments
 (0)