Skip to content

Commit c0aa555

Browse files
authored
Create README.md
1 parent 687960d commit c0aa555

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# PackageProject.cmake
2+
3+
A small helper script to simplify the CMake packaging process.
4+
5+
## Usage
6+
7+
To create an installable target for your current project, add the following to your CMakeLists.txt.
8+
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+
11+
```cmake
12+
CPMAddPackage(
13+
NAME PackageProject.cmake
14+
GITHUB_REPOSITORY TheLartians/PackageProject.cmake
15+
VERSION 1.0
16+
)
17+
18+
packageProject(
19+
NAME ${PROJECT_NAME}
20+
VERSION ${PROJECT_VERSION}
21+
BINARY_DIR ${PROJECT_BINARY_DIR}
22+
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
23+
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
24+
)
25+
```
26+
27+
If you need extra functionality feel free to open an issue or a PR.
28+

0 commit comments

Comments
 (0)