From 4ddab334af73a23aafddc86a79e8072ac4417d8f Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Thu, 28 Jun 2018 13:05:20 +0200 Subject: [PATCH] Adding a error if json requested but missing --- README.md | 3 ++- examples/CMakeLists.txt | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5ad3960..f80b2fb8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ CLI11 provides all the features you expect in a powerful command line parser, with a beautiful, minimal syntax and no dependencies beyond C++11. It is header only, and comes in a single file form for easy inclusion in projects. It is easy to use for small projects, but powerful enough for complex command line projects, and can be customized for frameworks. It is tested on [Travis] and [AppVeyor], and is being included in the [GooFit GPU fitting framework][GooFit]. It was inspired by [`plumbum.cli`][Plumbum] for Python. CLI11 has a user friendly introduction in this README, a more in-depth tutorial [GitBook], as well as [API documentation][api-docs] generated by Travis. -See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details for current and past releases. Also see the [Version 1.0 post] and [Version 1.3 post] for more information. +See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details for current and past releases. Also see the [Version 1.0 post], [Version 1.3 post], or [[Version 1.6 post] for more information. You can be notified when new releases are made by subscribing to https://github.com/CLIUtils/CLI11/releases.atom on an RSS reader, like Feedly. @@ -462,6 +462,7 @@ CLI11 was developed at the [University of Cincinnati] to support of the [GooFit] [Clara]: https://github.com/philsquared/Clara [Version 1.0 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-10/ [Version 1.3 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-13/ +[Version 1.6 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-16/ [wandbox-badge]: https://img.shields.io/badge/try-online-blue.svg [wandbox-link]: https://wandbox.org/permlink/Z4uwGhnhD2wm2r7Z [releases-badge]: https://img.shields.io/github/release/CLIUtils/CLI11.svg diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9679316a..f967ec54 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -16,11 +16,14 @@ endfunction() option(CLI11_EXAMPLE_JSON OFF) if(CLI11_EXAMPLE_JSON) + if(NOT EXISTS "${CLI11_SOURCE_DIR}/extern/json/single_include/nlohmann/json.hpp") + message(ERROR "You are missing the json package for CLI11_EXAMPLE_JSON. Please update your submodules (git submodule update --init)") + endif() if(CMAKE_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) message(WARNING "The json example requires GCC 4.9+ (requirement on json library)") endif() add_cli_exe(json json.cpp) - target_include_directories(json PUBLIC SYSTEM ../extern/json/single_include) + target_include_directories(json PUBLIC SYSTEM "${CLI11_SOURCE_DIR}/extern/json/single_include") add_test(NAME json_config_out COMMAND json --item 2) set_property(TEST json_config_out PROPERTY PASS_REGULAR_EXPRESSION