Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcl: restore zlib dep, adjust core types param #10

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions recipes/pcl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class PclConan(ConanFile):
# "with_rssdk": [True, False],
# "with_rssdk2": [True, False],
# "with_qvtk": [True, False],
"instantiate_only_core_point_types": [True, False],
# Precompile for a minimal set of point types only instead of all (e.g., pcl::PointXYZ instead of PCL_XYZ_POINT_TYPES)
"precompile_only_core_point_types": [True, False],
# Whether to append a ''/d/rd/s postfix to executables on Windows depending on the build type
"add_build_type_postfix": [True, False],
}
Expand Down Expand Up @@ -146,7 +147,8 @@ class PclConan(ConanFile):
"with_qhull": True,
"with_qt": True,
"with_vtk": False,
"instantiate_only_core_point_types": True,
# Enabled to avoid excessive memory usage during compilation in CCI
"precompile_only_core_point_types": True,
"add_build_type_postfix": False,
}

Expand All @@ -173,7 +175,9 @@ def _external_deps(self):
"gpu_surface": ["cuda"],
"gpu_tracking": ["cuda"],
"gpu_utils": ["cuda"],
"io": ["zlib"],
"people": ["vtk"],
"surface": ["zlib"],
"visualization": ["vtk"],
}

Expand Down Expand Up @@ -219,6 +223,7 @@ def _ext_dep_to_conan_target(self, dep):
"rssdk": [],
"rssdk2": [],
"vtk": [],
"zlib": ["zlib::zlib"],
}[dep]

@property
Expand Down Expand Up @@ -300,7 +305,7 @@ def _disabled_components(self, opts=None):
opts = opts or self.options
return {c for c in self._internal_deps if not opts.get_safe(c)} - {"common"}

def _all_ext_deps(self, opts):
def _used_ext_deps(self, opts):
all_deps = set()
for component in self._enabled_components(opts):
all_deps.update(self._external_deps.get(component, []))
Expand Down Expand Up @@ -350,9 +355,10 @@ def system_requirements(self):
self.output.warning("VTK must be installed manually on Windows.")

def _is_enabled(self, dep):
if dep in ["boost", "eigen"]:
return True
return self.options.get_safe(f"with_{dep}") and dep in self._all_ext_deps(self.options)
always_available = ["boost", "eigen", "zlib"]
is_available = self.options.get_safe(f"with_{dep}") or dep in always_available
is_used = dep in self._used_ext_deps(self.options)
return is_available and is_used

def requirements(self):
self.requires("boost/1.82.0", transitive_headers=True)
Expand All @@ -377,6 +383,8 @@ def requirements(self):
self.requires("glu/system", transitive_headers=True)
if self._is_enabled("opencv"):
self.requires("opencv/4.5.5", transitive_headers=True)
if self._is_enabled("zlib"):
self.requires("zlib/1.2.13")
# TODO:
# self.requires("vtk/9.x.x", transitive_headers=True)
# self.requires("openni/x.x.x", transitive_headers=True)
Expand All @@ -391,7 +399,7 @@ def requirements(self):
# self.requires("poisson4/x.x.x", transitive_headers=True)

def package_id(self):
used_deps = self._all_ext_deps(self.info.options)
used_deps = self._used_ext_deps(self.info.options)
# Disable options that have no effect
all_opts = [opt for opt, value in self.info.options.items()]
for opt in all_opts:
Expand Down Expand Up @@ -438,7 +446,7 @@ def generate(self):
tc.cache_variables["BUILD_CUDA"] = self._is_enabled("cuda")
tc.cache_variables["BUILD_GPU"] = self._is_enabled("cuda")
tc.cache_variables["WITH_SYSTEM_ZLIB"] = True
tc.cache_variables["PCL_ONLY_CORE_POINT_TYPES"] = self.options.instantiate_only_core_point_types
tc.cache_variables["PCL_ONLY_CORE_POINT_TYPES"] = self.options.precompile_only_core_point_types
# The default False setting breaks OpenGL detection in CMake
tc.cache_variables["PCL_ALLOW_BOTH_SHARED_AND_STATIC_DEPENDENCIES"] = True
tc.variables["OpenGL_GL_PREFERENCE"] = "GLVND"
Expand Down