Skip to content

Commit bb0be73

Browse files
committedApr 9, 2024·
Update find_package README section
1 parent a8e2158 commit bb0be73

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed
 

‎README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,34 @@ That's it, you are good to go.
4040

4141
### Use CMake's [`find_package()`](https://cmake.org/cmake/help/latest/command/find_package.html)
4242

43+
#### Option #1: `make install` (Preferred way)
44+
4345
After building the project, you can install it locally using `make install`.
4446
In your project's CMake file, you can then add the following snippet, and CMake will handle the rest:
4547
```
46-
find_package(pfs)
47-
include_directories (${pfs_INCLUDE_DIRS})
48+
find_package (pfs REQUIRED)
49+
...
50+
# Somewhere along the file you define your target
51+
add_<library|executable> (<your-target> ...)
4852
...
4953
target_link_libraries (<your-target> pfs)
5054
```
5155

52-
CMake generates an `install_manifest.txt` file to track all the created files, this will help you uninstall the library if you need to do so.
56+
NOTE: CMake generates an `install_manifest.txt` file to track all the created files, this will help you uninstall the library if you need to do so.
57+
58+
#### Option #2: Without `make install`
59+
60+
Build the `pfs` project. No need to call `make install`.
61+
In your project's CMake file, you can then add the following snippet:
62+
```
63+
find_package (pfs REQUIRED)
64+
...
65+
# Somewhere along the file you define your target
66+
add_<library|executable> (<your-target> ...)
67+
...
68+
target_link_libraries (<your-target> -L${pfs_LIBRARY_DIR} ${pfs_LIBRARIES})
69+
target_include_directories (<your-target> [PUBLIC|PRIVATE] ${pfs_INCLUDE_DIRS})
70+
```
5371

5472
## Features
5573

0 commit comments

Comments
 (0)
Please sign in to comment.