Last active
June 4, 2021 02:53
-
-
Save ihnorton/a2103a93a7a5a5f093010b5ecdfefaff to your computer and use it in GitHub Desktop.
vcpkg simple bootstrap test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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