mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-24 05:08:01 -05:00
update LarsParser in examples and Readme (#14)
This commit is contained in:
13
README.md
13
README.md
@@ -6,27 +6,28 @@ CPM is a minimalistic package manager written in Cmake using `find_package` and
|
|||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
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.
|
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 options can also be supplied with the package.
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||||
|
|
||||||
project(MyParser)
|
project(MyProject)
|
||||||
|
|
||||||
# add dependencies
|
# add dependencies
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake)
|
||||||
|
|
||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
NAME LarsParser
|
NAME LarsParser
|
||||||
VERSION 1.4 # optional, used for find_package
|
|
||||||
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
||||||
GIT_TAG v1.4 # optional if TAG matches v$VERSION
|
VERSION 1.8
|
||||||
|
OPTIONS
|
||||||
|
"LARS_PARSER_BUILD_GLUE_EXTENSION ON"
|
||||||
)
|
)
|
||||||
|
|
||||||
# add executable
|
# add executable
|
||||||
set (CMAKE_CXX_STANDARD 17)
|
set (CMAKE_CXX_STANDARD 17)
|
||||||
add_executable(my-parser my-parser.cpp)
|
add_executable(my-project my-project.cpp)
|
||||||
target_link_libraries(cpm-test LarsParser)
|
target_link_libraries(my-project LarsParser)
|
||||||
```
|
```
|
||||||
|
|
||||||
# Adding CPM
|
# Adding CPM
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ CPMAddPackage(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# language bindings
|
# language bindings
|
||||||
|
# uses git tag instead of version identifier
|
||||||
# depends on visitor library that depends on Event library and LHC (ignored as already added)
|
# depends on visitor library that depends on Event library and LHC (ignored as already added)
|
||||||
# configuration arguments passed via OPTIONS. these will all be set internally
|
# configuration arguments passed via OPTIONS. these will all be set internally
|
||||||
set(GLUE_ENABLE_LUA ON)
|
set(GLUE_ENABLE_LUA ON)
|
||||||
@@ -39,9 +40,9 @@ CPMAddPackage(
|
|||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
NAME LarsParser
|
NAME LarsParser
|
||||||
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
GIT_REPOSITORY https://github.com/TheLartians/Parser.git
|
||||||
VERSION 1.7
|
VERSION 1.8
|
||||||
OPTIONS
|
OPTIONS
|
||||||
"BUILD_LARS_PARSER_GLUE_EXTENSION ON"
|
"LARS_PARSER_BUILD_GLUE_EXTENSION ON"
|
||||||
)
|
)
|
||||||
|
|
||||||
# add executable
|
# add executable
|
||||||
|
|||||||
Reference in New Issue
Block a user