(#15496) flex: Avoid CMakeDeps messing with Conan targets

* Avoid CMakeDeps messing with Conan targets

* Getting back m4 as normal requires
This commit is contained in:
Francisco Ramírez
2023-01-28 01:46:30 +01:00
committed by GitHub
parent fc5e36d7c0
commit 747838f1fa
2 changed files with 8 additions and 1 deletions

View File

@@ -34,6 +34,11 @@ class FlexConan(ConanFile):
def export_sources(self):
export_conandata_patches(self)
def requirements(self):
# Flex requires M4 to be compiled. If consumer does not have M4
# installed, Conan will need to know that Flex requires it.
self.requires("m4/1.4.19")
def build_requirements(self):
self.tool_requires("m4/1.4.19")
if hasattr(self, "settings_build") and cross_building(self):
@@ -82,6 +87,8 @@ class FlexConan(ConanFile):
def package_info(self):
self.cpp_info.libs = ["fl"]
self.cpp_info.system_libs = ["m"]
# Avoid CMakeDeps messing with Conan targets
self.cpp_info.set_property("cmake_find_mode", "none")
bindir = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bindir))

View File

@@ -9,7 +9,7 @@ from conan.tools.cmake import CMake, cmake_layout
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv"
generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv", "CMakeDeps"
test_type = "explicit"
def requirements(self):