mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-25 05:37:28 -05:00
Update README.md
This commit is contained in:
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
# CPM
|
# CPM
|
||||||
|
|
||||||
CPM is a very simple package manager written in Cmake. It is extremely easy to use and drastically simplifies the inclusion of other Cmake-based projects from github.
|
CPM is a very simple package manager written in Cmake based on the amazing [DownloadProject](https://github.com/Crascit/DownloadProject) script. It is extremely easy to use and drastically simplifies the inclusion of other Cmake-based projects from github.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
To add a new dependency to your project simply add the Projects target name, the git URL and a valid git tag or branch.
|
To add a new dependency to your project simply add the Projects target name, the git URL and the version. If the git tag for this version does not match the pattern `v$VERSION`, then the exact branch or tag can be specified with the `GIT_TAG` argument.
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
|
||||||
@@ -20,6 +20,7 @@ CPMAddPackage(
|
|||||||
NAME LarsParser
|
NAME LarsParser
|
||||||
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
||||||
VERSION 1.2
|
VERSION 1.2
|
||||||
|
GIT_TAG master # optional
|
||||||
)
|
)
|
||||||
|
|
||||||
# add executable
|
# add executable
|
||||||
@@ -27,3 +28,7 @@ set (CMAKE_CXX_STANDARD 17)
|
|||||||
add_executable(my-parser my-parser.cpp)
|
add_executable(my-parser my-parser.cpp)
|
||||||
target_link_libraries(cpm-test LarsParser)
|
target_link_libraries(cpm-test LarsParser)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Current Limitations
|
||||||
|
|
||||||
|
- First version used: in diamond dependency graphs (e.g. `A` depends on `C`(v1.1) and `A` depends on `B` depends on `C`(v1.2)) the first added dependency will be used (in this case `C`@1.1).
|
||||||
|
|||||||
Reference in New Issue
Block a user