@@ -12,7 +12,6 @@ class RapidYAMLConan(ConanFile):
12
12
homepage = "https://github.com/biojppm/rapidyaml"
13
13
license = "MIT" ,
14
14
settings = "os" , "arch" , "compiler" , "build_type"
15
- exports_sources = ["CMakeLists.txt" ]
16
15
options = {
17
16
"shared" : [True , False ],
18
17
"fPIC" : [True , False ],
@@ -23,8 +22,7 @@ class RapidYAMLConan(ConanFile):
23
22
"fPIC" : True ,
24
23
"with_default_callbacks" : True ,
25
24
}
26
-
27
- generators = "cmake"
25
+ generators = "cmake" , "cmake_find_package_multi"
28
26
29
27
_compiler_required_cpp11 = {
30
28
"Visual Studio" : "13" ,
@@ -38,6 +36,11 @@ class RapidYAMLConan(ConanFile):
38
36
def _source_subfolder (self ):
39
37
return "source_subfolder"
40
38
39
+ def export_sources (self ):
40
+ self .copy ("CMakeLists.txt" )
41
+ for patch in self .conan_data .get ("patches" , {}).get (self .version , []):
42
+ self .copy (patch ["patch_file" ])
43
+
41
44
def config_options (self ):
42
45
if self .settings .os == "Windows" :
43
46
del self .options .fPIC
@@ -46,6 +49,9 @@ def configure(self):
46
49
if self .options .shared :
47
50
del self .options .fPIC
48
51
52
+ def requirements (self ):
53
+ self .requires ("c4core/0.1.8" )
54
+
49
55
def validate (self ):
50
56
if self .settings .compiler .get_safe ("cppstd" ):
51
57
tools .check_min_cppstd (self , 11 )
@@ -73,6 +79,8 @@ def _configure_cmake(self):
73
79
return self ._cmake
74
80
75
81
def build (self ):
82
+ for patch in self .conan_data .get ("patches" , {}).get (self .version , []):
83
+ tools .patch (** patch )
76
84
cmake = self ._configure_cmake ()
77
85
cmake .build ()
78
86
@@ -87,8 +95,7 @@ def package(self):
87
95
def package_info (self ):
88
96
self .cpp_info .set_property ("cmake_file_name" , "ryml" )
89
97
self .cpp_info .set_property ("cmake_target_name" , "ryml::ryml" )
90
- # TODO: create c4core recipe
91
- self .cpp_info .libs = ["ryml" , "c4core" ]
98
+ self .cpp_info .libs = ["ryml" ]
92
99
93
100
self .cpp_info .names ["cmake_find_package" ] = "ryml"
94
101
self .cpp_info .names ["cmake_find_package_multi" ] = "ryml"
0 commit comments