Skip to content

Commit

Permalink
(conan-io#15378) clipper: Minor recipe cleanup
Browse files Browse the repository at this point in the history
* clipper: Minor recipe cleanup

* Revert test v1 package

* Link against system library libm
  • Loading branch information
jwillikers authored and StellaSmith committed Feb 2, 2023
1 parent c38fac1 commit 4c1e56c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions recipes/clipper/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
import os

required_conan_version = ">=1.53.0"
required_conan_version = ">=1.54.0"


class ClipperConan(ConanFile):
name = "clipper"
description = "Clipper is an open source freeware polygon clipping library"
topics = ("clipper", "clipping", "polygon")
license = "BSL-1.0"
topics = ("clipping", "polygon")
url = "https://github.com/conan-io/conan-center-index"
homepage = "http://www.angusj.com/delphi/clipper.php"
license = "BSL-1.0"

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -39,16 +38,14 @@ def layout(self):
cmake_layout(self, src_folder="src")

def source(self):
get(self, **self.conan_data["sources"][self.version], destination=self.source_folder)
get(self, **self.conan_data["sources"][self.version])

def generate(self):
tc = CMakeToolchain(self)
# Export symbols for msvc shared
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
# To install relocatable shared libs on Macos
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
# TODO: can be removed if required_conan_version bumped to at least 1.54.0
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
tc.generate()

def build(self):
Expand All @@ -67,6 +64,9 @@ def package_info(self):
self.cpp_info.set_property("pkg_config_name", "polyclipping")
self.cpp_info.libs = ["polyclipping"]

if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.append("m")

# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed.
# Do not use these CMake names in CMakeDeps, it was a mistake,
# clipper doesn't provide CMake config file
Expand Down

0 comments on commit 4c1e56c

Please sign in to comment.