@@ -1,4 +1,5 @@
|
||||
import conan
|
||||
import conan.tools.build
|
||||
import conan.tools.cmake
|
||||
|
||||
class product_vamp_conan(conan.ConanFile):
|
||||
@@ -47,6 +48,9 @@ class product_vamp_conan(conan.ConanFile):
|
||||
"src/vamp_pico/*.cpp",
|
||||
"src/vamp_protocol/*.cpp",
|
||||
"src/vamp_zero/*.cpp",
|
||||
"tests/CMakeLists.txt",
|
||||
"tests/*.cpp",
|
||||
"tests/*.hpp",
|
||||
)
|
||||
|
||||
def requirements(self):
|
||||
@@ -72,12 +76,15 @@ class product_vamp_conan(conan.ConanFile):
|
||||
toolchain = conan.tools.cmake.CMakeToolchain(self)
|
||||
if hasattr(toolchain, "user_presets_path"):
|
||||
toolchain.user_presets_path = False
|
||||
toolchain.variables["BUILD_TESTING"] = bool(self.options.with_tests)
|
||||
toolchain.generate()
|
||||
|
||||
def build(self):
|
||||
cmake = conan.tools.cmake.CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
if self.options.with_tests and conan.tools.build.can_run(self):
|
||||
cmake.test(target="check")
|
||||
|
||||
def package_id(self):
|
||||
self.info.options.rm_safe("with_tests")
|
||||
|
||||
Reference in New Issue
Block a user