diff --git a/.gitignore b/.gitignore index 8884dfa..1ce0f6c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake build -.vscode \ No newline at end of file +.vscode +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 7ae829d..c6448e9 100644 --- a/README.md +++ b/README.md @@ -120,17 +120,6 @@ CPMAddPackage( ) ``` -### [Doctest](https://github.com/onqtam/doctest) - -```cmake -CPMAddPackage( - NAME doctest - GITHUB_REPOSITORY onqtam/doctest - GIT_TAG 2.3.2 -) -``` - - ### [Boost (via boost-cmake)](https://github.com/Orphis/boost-cmake) ```CMake @@ -141,6 +130,19 @@ CPMAddPackage( ) ``` +### [cxxopts](https://github.com/jarro2783/cxxopts) + +```cmake +CPMAddPackage( + NAME cxxopts + GITHUB_REPOSITORY jarro2783/cxxopts + VERSION 2.2.0 + OPTIONS + "CXXOPTS_BUILD_EXAMPLES Off" + "CXXOPTS_BUILD_TESTS Off" +) +``` + ### [Yaml-cpp](https://github.com/jbeder/yaml-cpp) ```CMake @@ -148,7 +150,7 @@ CPMAddPackage( NAME yaml-cpp GITHUB_REPOSITORY jbeder/yaml-cpp # 0.6.2 uses depricated CMake syntax - VERSION 0.6.3 + VERSION 0.6.3 # 0.6.3 is not released yet, so use a recent commit GIT_TAG 012269756149ae99745b6dafefd415843d7420bb OPTIONS @@ -215,13 +217,12 @@ endif() CPMAddPackage( NAME lua GIT_REPOSITORY https://github.com/lua/lua.git - GIT_TAG v5-3-4 - VERSION 5.3.4 + VERSION 5.3.5 DOWNLOAD_ONLY YES ) if (lua_ADDED) - # lua has no CMakeLists, so we create our own target + # lua has no CMake support, so we create our own target FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c) add_library(lua STATIC ${lua_sources}) diff --git a/examples/cxxopts/CMakeLists.txt b/examples/cxxopts/CMakeLists.txt new file mode 100644 index 0000000..14c4617 --- /dev/null +++ b/examples/cxxopts/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) + +# ---- Options ---- + +option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF) + +# ---- Dependencies ---- + +include(../../cmake/CPM.cmake) + +CPMAddPackage( + NAME cxxopts + GITHUB_REPOSITORY jarro2783/cxxopts + VERSION 2.2.0 + OPTIONS + "CXXOPTS_BUILD_EXAMPLES Off" + "CXXOPTS_BUILD_TESTS Off" +) + +# ---- Create binary ---- + +add_executable(CPMExampleCXXOpts main.cpp) +target_link_libraries(CPMExampleCXXOpts cxxopts) +set_target_properties(CPMExampleCXXOpts PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror") diff --git a/examples/cxxopts/main.cpp b/examples/cxxopts/main.cpp new file mode 100644 index 0000000..48f38e1 --- /dev/null +++ b/examples/cxxopts/main.cpp @@ -0,0 +1,23 @@ +#include +#include + +int main(int argc, char ** argv) { + cxxopts::Options options("MyProgram", "One line description of MyProgram"); + options.add_options() + ("h,help", "Show help") + ("d,debug", "Enable debugging") + ("f,file", "File name", cxxopts::value()); + + auto result = options.parse(argc, argv); + + if (result["help"].as()) { + std::cout << options.help() << std::endl; + return 0; + } + + for (auto arg: result.arguments()) { + std::cout << "option: " << arg.key() << ": " << arg.value() << std::endl; + } + + return 0; +} diff --git a/examples/parser-lua/CMakeLists.txt b/examples/parser-lua/CMakeLists.txt index 7c8f542..06d8f3a 100644 --- a/examples/parser-lua/CMakeLists.txt +++ b/examples/parser-lua/CMakeLists.txt @@ -7,7 +7,7 @@ include(../../cmake/CPM.cmake) CPMAddPackage( NAME Glue GIT_REPOSITORY https://github.com/TheLartians/Glue.git - VERSION 0.8.1 + VERSION 0.8.2 OPTIONS "GLUE_ENABLE_LUA ON" "GLUE_BUILD_LUA ON" diff --git a/examples/sol2/CMakeLists.txt b/examples/sol2/CMakeLists.txt index dc8448b..e8d33fb 100644 --- a/examples/sol2/CMakeLists.txt +++ b/examples/sol2/CMakeLists.txt @@ -7,8 +7,7 @@ include(../../cmake/CPM.cmake) CPMAddPackage( NAME lua GIT_REPOSITORY https://github.com/lua/lua.git - VERSION 5.3.4 - GIT_TAG v5-3-4 + VERSION 5.3.5 DOWNLOAD_ONLY YES )