Compare commits

..

3 Commits

Author SHA1 Message Date
Ron Hough e3800b3475 Clarifies path to 'build' dir 2023-03-04 14:56:53 -06:00
Ron Hough 89624e70c5 Ignores a file generated by conan setup
Also, sorts those gitignores.
2023-03-04 14:35:05 -06:00
Ron Hough abe3eab34c Use conan to add dependency on CLI11
(Also use some basic CLI11 to verify build/link works.)
2023-03-04 14:28:46 -06:00
5 changed files with 37 additions and 11 deletions

13
.gitignore vendored
View File

@ -1,12 +1,13 @@
CMakeLists.txt.user
CMakeCache.txt CMakeCache.txt
CMakeFiles CMakeFiles
CMakeLists.txt.user
CMakeScripts CMakeScripts
Testing CMakeUserPresets.json
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake CTestTestfile.cmake
Makefile
Testing
_deps _deps
build build
cmake_install.cmake
compile_commands.json
install_manifest.txt

View File

@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 3.24.2) 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 "${PROJECT_SOURCE_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)

7
conanfile.txt Normal file
View File

@ -0,0 +1,7 @@
[requires]
cli11/2.3.2
[generators]
CMakeDeps
CMakeToolchain

11
cppchallenge.cpp Normal file
View File

@ -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 :

View File

@ -1,6 +1,9 @@
#include<iostream> #include "CLI/CLI.hpp"
#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;
} }