Skip to content

Commit

Permalink
(#9158) tl-function-ref: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Feb 3, 2022
1 parent da9f459 commit 2422601
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions recipes/tl-function-ref/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conans import ConanFile, tools
import os

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.43.0"


class TlfunctionrefConan(ConanFile):
Expand All @@ -11,7 +11,7 @@ class TlfunctionrefConan(ConanFile):
topics = ("function_ref", "callable")
homepage = "https://github.com/TartanLlama/function_ref"
url = "https://github.com/conan-io/conan-center-index"
settings = "compiler"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

@property
Expand All @@ -34,9 +34,14 @@ def package(self):
self.copy("*", dst="include", src=os.path.join(self._source_subfolder, "include"))

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "tl-function-ref")
self.cpp_info.set_property("cmake_target_name", "tl::function-ref")

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.filenames["cmake_find_package"] = "tl-function-ref"
self.cpp_info.filenames["cmake_find_package_multi"] = "tl-function-ref"
self.cpp_info.names["cmake_find_package"] = "tl"
self.cpp_info.names["cmake_find_package_multi"] = "tl"
self.cpp_info.components["function-ref"].names["cmake_find_package"] = "function-ref"
self.cpp_info.components["function-ref"].names["cmake_find_package_multi"] = "function-ref"
self.cpp_info.components["function-ref"].set_property("cmake_target_name", "tl::function-ref")
2 changes: 1 addition & 1 deletion recipes/tl-function-ref/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def build(self):
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)

0 comments on commit 2422601

Please sign in to comment.