Skip to content

Commit a9c96a0

Browse files
author
Matthieu Longo
committed
[refactoring] add conanfile.py
1 parent d4d9bcc commit a9c96a0

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

conanfile.py

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
from conan import ConanFile
2+
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
3+
4+
required_conan_version = ">=1.53.0"
5+
6+
7+
class JsonLdCppConan(ConanFile):
8+
name = "jsonld-cpp"
9+
url = "https://github.com/dcdpr/jsonld-cpp"
10+
description = "Open Source C library that provides a set of parsers and serializers that generate Resource Description Framework (RDF) triples by parsing syntaxes or serialize the triples into a syntax."
11+
topics = "xml", "parser", "validation"
12+
homepage = "https://librdf.org/raptor/"
13+
license = "Apache License Version 2.0"
14+
15+
settings = "os", "arch", "compiler", "build_type"
16+
default_options = {
17+
"shared": False,
18+
"fPIC": True
19+
}
20+
options = {name: [True, False] for name in default_options.keys()}
21+
exports_sources = "*"
22+
23+
def configure(self):
24+
#self.options["rapidcheck"].enable_gmock = True
25+
self.options["rapidcheck"].enable_gtest = True
26+
27+
def requirements(self):
28+
#self.requires("boost/1.81.0")
29+
self.requires("nlohmann_json/3.11.2")
30+
31+
#self.requires("cpr/1.10.0", private=True)
32+
#FIXME: Is this dependency just pulled for uriparser ? Is there a good reason to pull http-link-header-cpp ?
33+
self.requires("http-link-header-cpp/0.9.0@amazon/testing", private=True)
34+
35+
self.requires("gtest/1.13.0", private=True, override=True)
36+
self.requires("rapidcheck/cci.20220514", private=True)
37+
38+
def generate(self):
39+
tc = CMakeToolchain(self)
40+
tc.variables["JSONLDCPP_BUILD_EXAMPLES"] = True
41+
tc.variables["JSONLDCPP_BUILD_TESTS"] = True
42+
tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True
43+
tc.generate()
44+
deps = CMakeDeps(self)
45+
deps.generate()
46+
47+
def build(self):
48+
cmake = CMake(self)
49+
project_variables = {
50+
"JSONLDCPP_BUILD_EXAMPLES": False,
51+
"JSONLDCPP_BUILD_TESTS": False,
52+
"CMAKE_VERBOSE_MAKEFILE": True,
53+
}
54+
cmake.configure(variables=project_variables)
55+
cmake.build()
56+
#FIXME: tests are failing
57+
#cmake.test()
58+
59+
def package(self):
60+
cmake = CMake(self)
61+
cmake.install()
62+
63+
def package_info(self):
64+
self.cpp_info.includedirs = ['include'] # Ordered list of include paths
65+
self.cpp_info.libs = ["jsonld-cpp", ] # The libs to link against
66+
self.cpp_info.system_libs = [] # System libs to link against
67+
self.cpp_info.libdirs = ['lib'] # Directories where libraries can be found

0 commit comments

Comments
 (0)