-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding fix for #75, rename requires to needs * Removing check for install commands (should still be run in subproject) * Adding conan build * Some small changes to CMake * Adding nicer Travis code * Adding package test, find works now
- Loading branch information
Showing
10 changed files
with
151 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
a.out* | ||
*.swp | ||
/*build* | ||
/test_package/build | ||
/Makefile | ||
/CMakeFiles/* | ||
/cmake_install.cmake |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from conans import ConanFile, CMake | ||
|
||
class HelloConan(ConanFile): | ||
name = "CLI11" | ||
version = "1.3.0" | ||
url = "https://github.com/CLIUtils/CLI11" | ||
settings = "os", "compiler", "arch", "build_type" | ||
license = "BSD 3 clause" | ||
description = "Command Line Interface toolkit for C++11" | ||
|
||
exports_sources = "LICENCE", "include/*", "cmake/*", "CMakeLists.txt", "tests/*" | ||
|
||
def build(self): # this is not building a library, just tests | ||
cmake = CMake(self) | ||
cmake.definitions["CLI_EXAMPLES"] = "OFF" | ||
cmake.definitions["CLI_SINGLE_FILE"] = "OFF" | ||
cmake.configure() | ||
cmake.build() | ||
cmake.test() | ||
cmake.install() | ||
|
||
def package_id(self): | ||
self.info.header_only() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
project(PackageTest CXX) | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
message(STATUS "${CMAKE_PREFIX_PATH}") | ||
|
||
find_package(CLI11 CONFIG REQUIRED) | ||
|
||
add_executable(example example.cpp) | ||
target_link_libraries(example CLI11::CLI11) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from conans import ConanFile, CMake | ||
import os | ||
|
||
class HelloTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def imports(self): | ||
self.copy("*.dll", dst="bin", src="bin") | ||
self.copy("*.dylib*", dst="bin", src="lib") | ||
|
||
def test(self): | ||
os.chdir("bin") | ||
self.run(".%sexample" % os.sep) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This file is a "Hello, world!" CLI11 program | ||
|
||
#include "CLI/CLI.hpp" | ||
|
||
#include <iostream> | ||
|
||
int main(int argc, char **argv) { | ||
|
||
CLI::App app("Some nice discription"); | ||
|
||
int x = 0; | ||
app.add_option("-x", x, "an integer value", true /* show default */); | ||
|
||
bool flag; | ||
app.add_flag("-f,--flag", flag, "a flag option"); | ||
|
||
CLI11_PARSE(app, argc, argv); | ||
|
||
return 0; | ||
} |