Use conan to add dependency on CLI11
(Also use some basic CLI11 to verify build/link works.)
This commit is contained in:
parent
4372688574
commit
abe3eab34c
|
|
@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.24.2)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
project(cppchallenge)
|
project(cppchallenge)
|
||||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "build")
|
find_package(CLI11 REQUIRED)
|
||||||
|
set(BUILD_DIR "build")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR})
|
||||||
|
set(CLI11_DIR ${BUILD_DIR})
|
||||||
file(GLOB SOURCES "src/*.cpp")
|
file(GLOB SOURCES "src/*.cpp")
|
||||||
add_executable(cppchallenge ${SOURCES})
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} CLI11::CLI11)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"vendor": {
|
||||||
|
"conan": {}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"/home/ronh/work/cpp-challenge/build/CMakePresets.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
[requires]
|
||||||
|
cli11/2.3.2
|
||||||
|
|
||||||
|
[generators]
|
||||||
|
CMakeDeps
|
||||||
|
CMakeToolchain
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "CLI/CLI.hpp"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]){
|
||||||
|
CLI::App app{"Just a simple 'hello'"};
|
||||||
|
CLI11_PARSE(app, argc, argv);
|
||||||
|
std::cout << "Hello World!" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// vim: set ts=4 expandtab :
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
|
#include "CLI/CLI.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
|
CLI::App app{"Just a simple 'hello'"};
|
||||||
|
CLI11_PARSE(app, argc, argv);
|
||||||
std::cout << "Hello World!" << std::endl;
|
std::cout << "Hello World!" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue