Skip to content

Commit

Permalink
Merge branch 'master' into qt5_fix_python2_versioncheck
Browse files Browse the repository at this point in the history
  • Loading branch information
wdobbe committed Dec 4, 2023
2 parents 08d993d + 6c19606 commit 9ec6fd4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion recipes/libcurl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def requirements(self):
if self.options.with_zstd:
self.requires("zstd/1.5.5")
if self.options.with_c_ares:
self.requires("c-ares/1.22.0")
self.requires("c-ares/1.22.1")
if self.options.get_safe("with_libpsl"):
self.requires("libpsl/0.21.1")

Expand Down
39 changes: 19 additions & 20 deletions recipes/lyra/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os

from conan import ConanFile
import conan.tools.files
import conan.tools.layout
import conan.tools.build
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout

required_conan_version = ">=1.50.0"

Expand All @@ -13,40 +14,38 @@ class LyraConan(ConanFile):
description = "A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond."
topics = ("cli", "cli-parser", "argparse", "commandline",
"flags", "header-only", "no-dependencies", "c++11")
no_copy_source = True
settings = "compiler"
url = "https://github.com/conan-io/conan-center-index"
license = "MIT"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
conan.tools.build.check_min_cppstd(self, 11)
def layout(self):
basic_layout(self, src_folder="src")

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

def layout(self):
conan.tools.layout.basic_layout(self, src_folder="root")
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)

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

def package(self):
conan.tools.files.copy(
self, "LICENSE.txt",
dst=os.path.join(self.package_folder, "licenses"),
src=self.source_folder)
conan.tools.files.copy(
copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
copy(
self, "*.h*",
dst=os.path.join(self.package_folder, "include"),
src=os.path.join(self.source_folder, "include"))

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "lyra")
self.cpp_info.set_property("cmake_target_name", "bfg::lyra")
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.components["_lyra"].set_property(
"cmake_target_name", "bfg::lyra")
Expand All @@ -56,5 +55,5 @@ def package_info(self):
self.cpp_info.names["cmake_find_package_multi"] = "bfg"
self.cpp_info.components["_lyra"].names["cmake_find_package"] = "lyra"
self.cpp_info.components["_lyra"].names["cmake_find_package_multi"] = "lyra"
self.cpp_info.components["_lyra"].bindirs = []
self.cpp_info.components["_lyra"].libdirs = []
self.cpp_info.libdirs = []
8 changes: 4 additions & 4 deletions recipes/lyra/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package CXX)
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

find_package(lyra REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} bfg::lyra)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME} PRIVATE bfg::lyra)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
12 changes: 6 additions & 6 deletions recipes/lyra/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
from conan import ConanFile
import conan.tools.build
import conan.tools.cmake
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
conan.tools.cmake.cmake_layout(self)
cmake_layout(self)

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

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

def test(self):
if conan.tools.build.can_run(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")

0 comments on commit 9ec6fd4

Please sign in to comment.