From f1d75bbb3286579da4030957d2497e53c1898c1d Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 6 Oct 2022 09:18:47 -0700 Subject: [PATCH 1/3] Remove unneeded explicit Compare function from map declarations std::less is the standard's default comparison function, we do not need to re-declare the same function. Signed-off-by: Sean Robinson --- include/argparse/argparse.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index a807919..23da43a 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -1644,11 +1644,11 @@ private: bool m_is_parsed = false; std::list m_positional_arguments; std::list m_optional_arguments; - std::map> m_argument_map; + std::map m_argument_map; std::string m_parser_path; std::list> m_subparsers; - std::map> m_subparser_map; - std::map> m_subparser_used; + std::map m_subparser_map; + std::map m_subparser_used; }; } // namespace argparse From 7af2342d9497cb1d6f5a8c815282cd2fe10c8e70 Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 6 Oct 2022 09:19:02 -0700 Subject: [PATCH 2/3] Remove link library from add_sample function Resolves the following build error: CMake Error at CMakeLists.txt:26 (ADD_EXECUTABLE): Target "ARGPARSE_SAMPLE_custom_assignment_characters" links to target "argparse::argparse" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Signed-off-by: Sean Robinson --- samples/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index b146b2d..94ba3b5 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -25,7 +25,6 @@ endif() function(add_sample NAME) ADD_EXECUTABLE(ARGPARSE_SAMPLE_${NAME} ${NAME}.cpp) INCLUDE_DIRECTORIES("../include" ".") - TARGET_LINK_LIBRARIES(ARGPARSE_SAMPLE_${NAME} PRIVATE argparse::argparse) set_target_properties(ARGPARSE_SAMPLE_${NAME} PROPERTIES OUTPUT_NAME ${NAME}) endfunction() From 0c83c631c54c50cf93335ebff2f47ad40f81a861 Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Thu, 6 Oct 2022 09:19:10 -0700 Subject: [PATCH 3/3] Update CMake version in README example for FetchContent FetchContent_MakeAvailable was added in CMake v3.14. Also includes end-of-line whitespace clean-ups. Signed-off-by: Sean Robinson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b63101..e03573e 100644 --- a/README.md +++ b/README.md @@ -1092,7 +1092,7 @@ foo@bar:/home/dev/$ ./test --bar=BAR --foo Use the latest argparse in your CMake project without copying any content. ```cmake -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.14) PROJECT(myproject)