From 17d567c283a157c279f294d8cd85282829ff43d8 Mon Sep 17 00:00:00 2001 From: Adrian Schneider Date: Sat, 9 Jul 2022 17:04:02 +0200 Subject: [PATCH] Extend Readme with CMake FetchContent integration of argparse. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 0399d5a..b89fbb2 100644 --- a/README.md +++ b/README.md @@ -775,6 +775,26 @@ $ ./main fex baz ``` +## CMake Integration + +Use the latest argparse in your CMake project without copying any content. + +```cmake +cmake_minimum_required(VERSION 3.11) + +PROJECT(myproject) + +# fetch latest argparse +include(FetchContent) +FetchContent_Declare( + argparse + GIT_REPOSITORY https://github.com/p-ranav/argparse.git +) +FetchContent_MakeAvailable(argparse) + +add_executable(myproject main.cpp) +target_link_libraries(myproject argparse) +``` ## Supported Toolchains | Compiler | Standard Library | Test Environment |