Skip to content

Commit 5e8487d

Browse files
committed
Update README.md
1 parent e3899a9 commit 5e8487d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# PackageProject.cmake
22

3-
A small helper script to simplify the CMake packaging process.
3+
Creating installable CMake scripts always requires a large amount of boilerplate code to get things working.
4+
This small script should simplify the CMake packaging process into a single, easy-to-use command.
45

56
## Usage
67

78
To create an installable target for your current project, add the following to your CMakeLists.txt.
89
This example assumes the project to be versioned and the name to be identical to the library to export.
9-
Also the [CPM.cmake](https://github.com/TheLartians/CPM.cmake) should be included.
10+
Also the [CPM.cmake](https://github.com/TheLartians/CPM.cmake) script should be included.
11+
See [here](https://github.com/TheLartians/ModernCppStarter/blob/master/CMakeLists.txt) for an example usage.
1012

1113
```cmake
1214
CPMAddPackage(
@@ -16,13 +18,17 @@ CPMAddPackage(
1618
)
1719
1820
packageProject(
21+
# the name of the target to export
1922
NAME ${PROJECT_NAME}
23+
# the version of the target to export
2024
VERSION ${PROJECT_VERSION}
25+
# a temporary directory to create the config files
2126
BINARY_DIR ${PROJECT_BINARY_DIR}
27+
# location of the target's public headers
2228
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
29+
# should match the target's INSTALL_INTERFACE include directory
2330
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
2431
)
2532
```
2633

2734
If you need extra functionality feel free to open an issue or a PR.
28-

0 commit comments

Comments
 (0)