forked from ericLemanissier/conan-center-index
xproperty: add version 0.12.0 (#24219)
Co-authored-by: PerseoGI <perseog@jfrog.com>
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
sources:
|
sources:
|
||||||
|
"0.12.0":
|
||||||
|
url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.12.0.tar.gz"
|
||||||
|
sha256: "27cbc8e441dcc515a1ebbf11bad5ef240748d32f5e1adf84deed87a1dc57a440"
|
||||||
"0.11.0":
|
"0.11.0":
|
||||||
url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.11.0.tar.gz"
|
url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.11.0.tar.gz"
|
||||||
sha256: "bf86a11c6758308aa0aa0f64d8dd24cd3e9d78378467b74002f552bfb75fc0eb"
|
sha256: "bf86a11c6758308aa0aa0f64d8dd24cd3e9d78378467b74002f552bfb75fc0eb"
|
||||||
|
@@ -2,35 +2,42 @@ from conan import ConanFile
|
|||||||
from conan.tools.build import check_min_cppstd
|
from conan.tools.build import check_min_cppstd
|
||||||
from conan.tools.files import copy, get, save
|
from conan.tools.files import copy, get, save
|
||||||
from conan.tools.layout import basic_layout
|
from conan.tools.layout import basic_layout
|
||||||
|
from conan.tools.scm import Version
|
||||||
import os
|
import os
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
required_conan_version = ">=1.52.0"
|
required_conan_version = ">=2.1.0"
|
||||||
|
|
||||||
|
|
||||||
class XpropertyConan(ConanFile):
|
class XpropertyConan(ConanFile):
|
||||||
name = "xproperty"
|
name = "xproperty"
|
||||||
description = "Traitlets-like C++ properties and implementation of the observer pattern."
|
description = "Traitlets-like C++ properties and implementation of the observer pattern."
|
||||||
license = "BSD-3-Clause"
|
license = "BSD-3-Clause"
|
||||||
topics = ("observer", "traitlets")
|
|
||||||
homepage = "https://github.com/jupyter-xeus/xproperty"
|
|
||||||
url = "https://github.com/conan-io/conan-center-index"
|
url = "https://github.com/conan-io/conan-center-index"
|
||||||
|
homepage = "https://github.com/jupyter-xeus/xproperty"
|
||||||
|
topics = ("observer", "traitlets", "header-only")
|
||||||
package_type = "header-library"
|
package_type = "header-library"
|
||||||
settings = "os", "arch", "compiler", "build_type"
|
settings = "os", "arch", "compiler", "build_type"
|
||||||
no_copy_source = True
|
no_copy_source = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _min_cppstd(self):
|
||||||
|
return "14" if Version(self.version) <= "0.12.0" else "17"
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
basic_layout(self, src_folder="src")
|
basic_layout(self, src_folder="src")
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True)
|
if Version(self.version) < "0.12.0":
|
||||||
|
self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True)
|
||||||
|
else:
|
||||||
|
self.requires("nlohmann_json/3.11.3")
|
||||||
|
|
||||||
def package_id(self):
|
def package_id(self):
|
||||||
self.info.clear()
|
self.info.clear()
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.settings.compiler.get_safe("cppstd"):
|
check_min_cppstd(self, self._min_cppstd)
|
||||||
check_min_cppstd(self, 14)
|
|
||||||
|
|
||||||
def source(self):
|
def source(self):
|
||||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||||
|
@@ -5,4 +5,8 @@ find_package(xproperty REQUIRED CONFIG)
|
|||||||
|
|
||||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE xproperty)
|
target_link_libraries(${PROJECT_NAME} PRIVATE xproperty)
|
||||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
if(xproperty_VERSION VERSION_LESS "0.12.0")
|
||||||
|
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
||||||
|
else()
|
||||||
|
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
|
||||||
|
endif()
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
versions:
|
versions:
|
||||||
|
"0.12.0":
|
||||||
|
folder: all
|
||||||
"0.11.0":
|
"0.11.0":
|
||||||
folder: all
|
folder: all
|
||||||
|
Reference in New Issue
Block a user