Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/lunarlog/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"1.29.1":
url: "https://github.com/LunarECL/LunarLog/archive/refs/tags/v1.29.1.tar.gz"
sha256: "26dd58efb61468fa8e76e6cbd0cd23f5234e5aac6fb24d0ec5f83460ce59eb11"
39 changes: 39 additions & 0 deletions recipes/lunarlog/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from conan import ConanFile
from conan.tools.files import get, copy
from conan.tools.layout import basic_layout
import os


class LunarLogConan(ConanFile):
name = "lunarlog"
description = "Header-only C++11 structured logging library with message templates. Inspired by Serilog."
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/LunarECL/LunarLog"
topics = ("logging", "structured-logging", "header-only", "cpp11", "message-templates", "serilog")
package_type = "header-library"
settings = "os", "compiler", "build_type", "arch"
no_copy_source = True

def layout(self):
basic_layout(self, src_folder="src")

def package_id(self):
self.info.clear()

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*.hpp",
os.path.join(self.source_folder, "include"),
os.path.join(self.package_folder, "include"))

def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
self.cpp_info.set_property("cmake_file_name", "LunarLog")
self.cpp_info.set_property("cmake_target_name", "LunarLog::LunarLog")
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.append("pthread")
8 changes: 8 additions & 0 deletions recipes/lunarlog/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.15)
project(test_package CXX)

find_package(LunarLog REQUIRED CONFIG)

add_executable(test_package test_package.cpp)
target_link_libraries(test_package PRIVATE LunarLog::LunarLog)
target_compile_features(test_package PRIVATE cxx_std_11)
24 changes: 24 additions & 0 deletions recipes/lunarlog/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake


class LunarLogTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"

def requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if can_run(self):
self.run(os.path.join(self.cpp.build.bindir, "test_package"), env="conanrun")
12 changes: 12 additions & 0 deletions recipes/lunarlog/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <lunar_log/lunar_log.hpp>
#include <iostream>

int main() {
auto logger = lunar_log::LoggerConfiguration()
.writeTo().console()
.createLogger();

logger->information("Hello from LunarLog {Version}", "1.29.1");
std::cout << "LunarLog test_package OK" << std::endl;
return 0;
}
3 changes: 3 additions & 0 deletions recipes/lunarlog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"1.29.1":
folder: all