Commit 4ddab334af73a23aafddc86a79e8072ac4417d8f
1 parent
4974afb4
Adding a error if json requested but missing
Showing
2 changed files
with
6 additions
and
2 deletions
README.md
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | 17 | ||
| 18 | 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. | 18 | 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. |
| 19 | 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. | 19 | 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. |
| 20 | -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. | 20 | +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. |
| 21 | 21 | ||
| 22 | 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. | 22 | 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. |
| 23 | 23 | ||
| @@ -462,6 +462,7 @@ CLI11 was developed at the [University of Cincinnati] to support of the [GooFit] | @@ -462,6 +462,7 @@ CLI11 was developed at the [University of Cincinnati] to support of the [GooFit] | ||
| 462 | [Clara]: https://github.com/philsquared/Clara | 462 | [Clara]: https://github.com/philsquared/Clara |
| 463 | [Version 1.0 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-10/ | 463 | [Version 1.0 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-10/ |
| 464 | [Version 1.3 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-13/ | 464 | [Version 1.3 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-13/ |
| 465 | +[Version 1.6 post]: https://iscinumpy.gitlab.io/post/announcing-cli11-16/ | ||
| 465 | [wandbox-badge]: https://img.shields.io/badge/try-online-blue.svg | 466 | [wandbox-badge]: https://img.shields.io/badge/try-online-blue.svg |
| 466 | [wandbox-link]: https://wandbox.org/permlink/Z4uwGhnhD2wm2r7Z | 467 | [wandbox-link]: https://wandbox.org/permlink/Z4uwGhnhD2wm2r7Z |
| 467 | [releases-badge]: https://img.shields.io/github/release/CLIUtils/CLI11.svg | 468 | [releases-badge]: https://img.shields.io/github/release/CLIUtils/CLI11.svg |
examples/CMakeLists.txt
| @@ -16,11 +16,14 @@ endfunction() | @@ -16,11 +16,14 @@ endfunction() | ||
| 16 | 16 | ||
| 17 | option(CLI11_EXAMPLE_JSON OFF) | 17 | option(CLI11_EXAMPLE_JSON OFF) |
| 18 | if(CLI11_EXAMPLE_JSON) | 18 | if(CLI11_EXAMPLE_JSON) |
| 19 | + if(NOT EXISTS "${CLI11_SOURCE_DIR}/extern/json/single_include/nlohmann/json.hpp") | ||
| 20 | + message(ERROR "You are missing the json package for CLI11_EXAMPLE_JSON. Please update your submodules (git submodule update --init)") | ||
| 21 | + endif() | ||
| 19 | if(CMAKE_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) | 22 | if(CMAKE_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) |
| 20 | message(WARNING "The json example requires GCC 4.9+ (requirement on json library)") | 23 | message(WARNING "The json example requires GCC 4.9+ (requirement on json library)") |
| 21 | endif() | 24 | endif() |
| 22 | add_cli_exe(json json.cpp) | 25 | add_cli_exe(json json.cpp) |
| 23 | - target_include_directories(json PUBLIC SYSTEM ../extern/json/single_include) | 26 | + target_include_directories(json PUBLIC SYSTEM "${CLI11_SOURCE_DIR}/extern/json/single_include") |
| 24 | 27 | ||
| 25 | add_test(NAME json_config_out COMMAND json --item 2) | 28 | add_test(NAME json_config_out COMMAND json --item 2) |
| 26 | set_property(TEST json_config_out PROPERTY PASS_REGULAR_EXPRESSION | 29 | set_property(TEST json_config_out PROPERTY PASS_REGULAR_EXPRESSION |