From d74c8d6d4d47a39acf49066492dc1a6284f916b9 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Tue, 1 Feb 2022 15:43:09 -0800 Subject: [PATCH] Add cxxopts command line parsing library We'll use this to better manage the fairly large set of command line options in self-contained objects instead of a scattering of individual stack variables. Signed-off-by: Mark Stemm --- CMakeLists.txt | 2 ++ cmake/modules/cxxopts.cmake | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 cmake/modules/cxxopts.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 77dbc2d4..06297c95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,8 @@ if(NOT MINIMAL_BUILD) include(civetweb) endif() +include(cxxopts) + # Lpeg include(lpeg) diff --git a/cmake/modules/cxxopts.cmake b/cmake/modules/cxxopts.cmake new file mode 100644 index 00000000..d75445ac --- /dev/null +++ b/cmake/modules/cxxopts.cmake @@ -0,0 +1,23 @@ +# +# Copyright (C) 2022 The Falco Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# + +set(CXXOPTS_SRC "${PROJECT_BINARY_DIR}/cxxopts-prefix/src/cxxopts/") +set(CXXOPTS_INCLUDE_DIR "${CXXOPTS_SRC}/include") + +ExternalProject_Add( + cxxopts + URL "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.0.0.tar.gz" + URL_HASH "SHA256=36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "")