-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow better conan/cmake interop
Makes find_package(span-lite) work as expected from CMake projects that use conan to handle dependencies.
- Loading branch information
1 parent
d99da52
commit 4d9d174
Showing
1 changed file
with
9 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
from conans import ConanFile | ||
from conans import ConanFile, CMake | ||
|
||
class SpanLiteConan(ConanFile): | ||
version = "0.4.0" | ||
name = "span-lite" | ||
description = "A C++20-like span for C++98, C++11 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/span-lite.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): | ||
"""Avoid warning on build step""" | ||
pass | ||
|
||
def package(self): | ||
"""Provide pkg/include/nonstd/*.hpp""" | ||
self.copy("*.hpp") | ||
"""Run CMake install""" | ||
cmake = CMake(self) | ||
cmake.definitions["SPAN_LITE_OPT_BUILD_TESTS"] = "OFF" | ||
cmake.definitions["SPAN_LITE_OPT_BUILD_EXAMPLES"] = "OFF" | ||
cmake.configure() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
self.info.header_only() |