Skip to content

Commit

Permalink
libigl: add VirtualBuildEnv, rmdir lib/cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 4, 2023
1 parent ccbc714 commit 23e1936
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipes/libigl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import copy, get, rm, rmdir, replace_in_file
from conan.tools.microsoft import is_msvc_static_runtime
from conan.tools.scm import Version
Expand Down Expand Up @@ -65,7 +66,7 @@ def layout(self):
def requirements(self):
# Eigen v3.4+ is not compatible
self.requires("eigen/3.3.9", transitive_headers=True)

def build_requirements(self):
self.tool_requires("cmake/[>=3.16 <4]")

Expand All @@ -91,6 +92,9 @@ def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
env = VirtualBuildEnv(self)
env.generate()

tc = CMakeToolchain(self)
tc.cache_variables["LIBIGL_INSTALL"] = True
tc.cache_variables["LIBIGL_EXPORT_TARGETS"] = True
Expand Down Expand Up @@ -143,6 +147,7 @@ def package(self):
copy(self, "LICENSE.MPL2", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)

rmdir(self, os.path.join(self.package_folder, "share"))
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
if not self.options.header_only:
rm(self, "*.c", self.package_folder, recursive=True)
rm(self, "*.cpp", self.package_folder, recursive=True)
Expand Down

0 comments on commit 23e1936

Please sign in to comment.