11from conan import ConanFile
22from conan .errors import ConanInvalidConfiguration
33from conan .tools .build .cppstd import check_min_cppstd
4- from conan .tools .cmake import CMake , CMakeToolchain , cmake_layout
4+ from conan .tools .cmake import CMake , CMakeDeps , CMakeToolchain , cmake_layout
55from conan .tools .files import copy
66from conan .tools .scm import Version
77import os
@@ -18,7 +18,6 @@ class SparrowIPCRecipe(ConanFile):
1818 topics = ("arrow" , "apache arrow" , "columnar format" , "dataframe" , "ipc" , "serialization" , "deserialization" , "flatbuffers" )
1919 package_type = "library"
2020 settings = "os" , "arch" , "compiler" , "build_type"
21- generators = "CMakeDeps"
2221 exports_sources = "include/*" , "src/*" , "cmake/*" , "CMakeLists.txt" , "LICENSE"
2322 options = {
2423 "shared" : [True , False ],
@@ -45,6 +44,9 @@ def requirements(self):
4544 if self .options .get_safe ("build_tests" ):
4645 self .test_requires ("doctest/2.4.12" )
4746
47+ def build_requirements (self ):
48+ self .tool_requires ("cmake/[>=3.28.1 <4.2.0]" )
49+
4850 @property
4951 def _min_cppstd (self ):
5052 return 20
@@ -73,7 +75,11 @@ def layout(self):
7375 cmake_layout (self , src_folder = "." )
7476
7577 def generate (self ):
78+ deps = CMakeDeps (self )
79+ deps .generate ()
80+
7681 tc = CMakeToolchain (self )
82+ tc .variables ["SPARROW_IPC_BUILD_SHARED" ] = self .options .shared
7783 tc .variables ["SPARROW_IPC_BUILD_TESTS" ] = self .options .build_tests
7884 tc .generate ()
7985
0 commit comments