Skip to content

Commit 2a2dcc2

Browse files
Add CMake integration steps to README
1 parent 98b0170 commit 2a2dcc2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,27 @@ an issue or a Pull Request, please read [Contribution Guide](./CONTRIBUTING.md).
398398
To enable logging in UMF source files please follow the guide in the
399399
[web documentation](https://oneapi-src.github.io/unified-memory-framework/introduction.html#logging).
400400

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

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

0 commit comments

Comments
 (0)