diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..6556785 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile + + +class ScopeguardConan(ConanFile): + name = "scope_guard" + version = "0.2.4-dev.1" + license = "The Unlicense" + author = "Ricardo Abreu ricab@ricabhome.org" + url = "https://github.com/ricab/scope_guard" + homepage = "https://ricab.github.io/scope_guard/" + description = "A modern C++ scope guard that is easy to use but hard to misuse." + topics = ("scope guard", "RAII", "resource management", "idioms", + "header-only", "single-file") + exports_sources = "scope_guard.hpp" + no_copy_source = True + + def package(self): + self.copy("scope_guard.hpp", dst="include") diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt new file mode 100644 index 0000000..b812380 --- /dev/null +++ b/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 17) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/test_package/conanfile.py b/test_package/conanfile.py new file mode 100644 index 0000000..f272329 --- /dev/null +++ b/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class ScopeguardTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + os.chdir("bin") + self.run(".%sexample" % os.sep) diff --git a/test_package/example.cpp b/test_package/example.cpp new file mode 100644 index 0000000..2f83c5d --- /dev/null +++ b/test_package/example.cpp @@ -0,0 +1,7 @@ +#include + +#include + +int main() { + auto guard = sg::make_scope_guard([]() noexcept { return; }); +}