Skip to content

Instantly share code, notes, and snippets.

@ihnorton
Last active June 4, 2021 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihnorton/a2103a93a7a5a5f093010b5ecdfefaff to your computer and use it in GitHub Desktop.
Save ihnorton/a2103a93a7a5a5f093010b5ecdfefaff to your computer and use it in GitHub Desktop.
vcpkg simple bootstrap test
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare(
vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg.git
GIT_TAG 2021.05.12
)
FetchContent_MakeAvailable(vcpkg)
set(CMAKE_TOOLCHAIN_FILE ${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake
CACHE STRING "CMake toolchain file")
project(demo)
find_package(argh)
add_executable(main main.cc)
target_link_libraries(main argh)
#include <iostream>
#include "argh.h"
// Repository: https://github.com/adishavit/argh
// BSD-3 License: https://github.com/adishavit/argh/blob/master/LICENSE
int main(int, char* argv[])
{
argh::parser cmdl(argv);
if (cmdl[{ "-v", "--verbose" }])
std::cout << "Verbose, I am.\n";
return EXIT_SUCCESS;
}
{
"name": "demo",
"version-string": "0",
"dependencies": [
"argh"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment