add abseil recipe

This commit is contained in:
aleksandr.vodyanov
2024-11-14 13:52:51 +03:00
commit 1853b851ff
17 changed files with 742 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)

View File

@@ -0,0 +1,20 @@
from conans import ConanFile, CMake, tools
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"
def build(self):
cmake = CMake(self)
cmake.definitions["CXX20_SUPPORTED"] = tools.Version(self.deps_cpp_info["abseil"].version) > "20210324.2"
cmake.configure()
cmake.build()
def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(f"{bin_path} -s", run_environment=True)
bin_global_path = os.path.join("bin", "test_package_global")
self.run(f"{bin_global_path} -s", run_environment=True)