Skip to content

Commit 84783d8

Browse files
committed
Improve conan/cmake interoperation (nonstd-lite issue 32)
- martinmoene/nonstd-lite-project#32
1 parent 16a4c13 commit 84783d8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

conanfile.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
from conans import ConanFile
1+
from conans import ConanFile, CMake
22

33
class OptionalLiteConan(ConanFile):
44
version = "3.1.1"
55
name = "optional-lite"
66
description = "A single-file header-only version of a C++17-like optional, a nullable object for C++98, C++11 and later"
77
license = "Boost Software License - Version 1.0. http://www.boost.org/LICENSE_1_0.txt"
88
url = "https://github.com/martinmoene/optional-lite.git"
9-
exports_sources = "include/nonstd/*", "LICENSE.txt"
10-
build_policy = "missing"
9+
exports_sources = "include/nonstd/*", "CMakeLists.txt", "cmake/*", "LICENSE.txt"
10+
build_policy = "missing"
1111
author = "Martin Moene"
1212

1313
def build(self):
1414
"""Avoid warning on build step"""
1515
pass
1616

1717
def package(self):
18-
"""Provide pkg/include/nonstd/*.hpp"""
19-
self.copy("*.hpp")
18+
"""Run CMake install"""
19+
cmake = CMake(self)
20+
cmake.definitions["OPTIONAL_LITE_OPT_BUILD_TESTS"] = "OFF"
21+
cmake.definitions["OPTIONAL_LITE_OPT_BUILD_EXAMPLES"] = "OFF"
22+
cmake.configure()
23+
cmake.install()
2024

2125
def package_info(self):
2226
self.info.header_only()

0 commit comments

Comments
 (0)