diff --git a/README.md b/README.md index 0882dfd..47d17c5 100644 --- a/README.md +++ b/README.md @@ -6,27 +6,28 @@ CPM is a minimalistic package manager written in Cmake using `find_package` and # 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_minimum_required(VERSION 3.14 FATAL_ERROR) -project(MyParser) +project(MyProject) # add dependencies include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake) CPMAddPackage( NAME LarsParser - VERSION 1.4 # optional, used for find_package 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 set (CMAKE_CXX_STANDARD 17) -add_executable(my-parser my-parser.cpp) -target_link_libraries(cpm-test LarsParser) +add_executable(my-project my-project.cpp) +target_link_libraries(my-project LarsParser) ``` # Adding CPM diff --git a/tests/complex/CMakeLists.txt b/tests/complex/CMakeLists.txt index 42248d9..52e0797 100644 --- a/tests/complex/CMakeLists.txt +++ b/tests/complex/CMakeLists.txt @@ -22,6 +22,7 @@ CPMAddPackage( ) # language bindings +# uses git tag instead of version identifier # 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 set(GLUE_ENABLE_LUA ON) @@ -39,9 +40,9 @@ CPMAddPackage( CPMAddPackage( NAME LarsParser GIT_REPOSITORY https://github.com/TheLartians/Parser.git - VERSION 1.7 + VERSION 1.8 OPTIONS - "BUILD_LARS_PARSER_GLUE_EXTENSION ON" + "LARS_PARSER_BUILD_GLUE_EXTENSION ON" ) # add executable