From b55c93d2ef077b96e5ca7f821301f4e5b1a16315 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Tue, 9 Apr 2019 16:04:04 +0200 Subject: [PATCH] Update README.md --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fee87d8..f0cd250 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,29 @@ [![Build Status](https://travis-ci.com/TheLartians/CPM.svg?branch=master)](https://travis-ci.com/TheLartians/CPM) # CPM -Simple Cmake + git based package management + +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. + +# 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. + +```cmake +cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + +project(MyParser) + +# add dependencies +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake) + +CPMAddPackage( + NAME LarsParser + GIT_REPOSITORY https://github.com/TheLartians/Parser.git + VERSION 1.2 +) + +# add executable +set (CMAKE_CXX_STANDARD 17) +add_executable(my-parser my-parser.cpp) +target_link_libraries(cpm-test LarsParser) +```