From b511f717f8e5bc94558325a1a17b8d87ce6404aa Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Thu, 18 Apr 2019 08:40:20 +0200 Subject: [PATCH] Improve conan/cmake interoperation (nonstd-lite issue 32) - https://github.com/martinmoene/nonstd-lite-project/issues/32 --- conanfile.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/conanfile.py b/conanfile.py index 5147f92..c1a3e5e 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile +from conans import ConanFile, CMake class OptionalBareConan(ConanFile): version = "1.0.0" @@ -6,8 +6,8 @@ class OptionalBareConan(ConanFile): description = "A simple version of a C++17-like optional for default-constructible, copyable types, for C++98 and later in a single-file header-only library" license = "Boost Software License - Version 1.0. http://www.boost.org/LICENSE_1_0.txt" url = "https://github.com/martinmoene/optional-bare.git" - exports_sources = "include/nonstd/*", "LICENSE.txt" - build_policy = "missing" + exports_sources = "include/nonstd/*", "CMakeLists.txt", "cmake/*", "LICENSE.txt" + build_policy = "missing" author = "Martin Moene" def build(self): @@ -15,8 +15,12 @@ def build(self): pass def package(self): - """Provide pkg/include/nonstd/*.hpp""" - self.copy("*.hpp") + """Run CMake install""" + cmake = CMake(self) + cmake.definitions["OPTIONAL_BARE_OPT_BUILD_TESTS"] = "OFF" + cmake.definitions["OPTIONAL_BARE_OPT_BUILD_EXAMPLES"] = "OFF" + cmake.configure() + cmake.install() def package_info(self): self.info.header_only()