mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57:16 +02:00
build: CMakeDeps support added
This commit is contained in:
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
from conans import ConanFile, tools
|
from conans import ConanFile, tools
|
||||||
from conans.tools import Version, check_min_cppstd
|
from conans.tools import Version, check_min_cppstd
|
||||||
from conan.tools.cmake import CMakeToolchain, CMake
|
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps
|
||||||
from conans.errors import ConanInvalidConfiguration
|
from conans.errors import ConanInvalidConfiguration
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class UnitsConan(ConanFile):
|
|||||||
# "revision": "auto",
|
# "revision": "auto",
|
||||||
# "submodule": "recursive"
|
# "submodule": "recursive"
|
||||||
# }
|
# }
|
||||||
generators = "cmake_find_package_multi", "cmake_paths"
|
generators = "cmake_paths"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _run_tests(self):
|
def _run_tests(self):
|
||||||
@ -114,6 +114,8 @@ class UnitsConan(ConanFile):
|
|||||||
# if self._run_tests: # TODO Enable this when environment is supported in the Conan toolchain
|
# if self._run_tests: # TODO Enable this when environment is supported in the Conan toolchain
|
||||||
tc.variables["UNITS_BUILD_DOCS"] = self.options.build_docs
|
tc.variables["UNITS_BUILD_DOCS"] = self.options.build_docs
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
deps = CMakeDeps(self)
|
||||||
|
deps.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = self._configure_cmake()
|
cmake = self._configure_cmake()
|
||||||
|
@ -21,15 +21,16 @@
|
|||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
from conans import ConanFile, tools, RunEnvironment
|
from conans import ConanFile, tools, RunEnvironment
|
||||||
from conan.tools.cmake import CMakeToolchain, CMake
|
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps
|
||||||
|
|
||||||
class TestPackageConan(ConanFile):
|
class TestPackageConan(ConanFile):
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
generators = "cmake_find_package_multi"
|
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
tc = CMakeToolchain(self)
|
tc = CMakeToolchain(self)
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
deps = CMakeDeps(self)
|
||||||
|
deps.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = CMake(self)
|
cmake = CMake(self)
|
||||||
|
Reference in New Issue
Block a user