Skip to content

Commit

Permalink
pcl: fix build issues, simplify OpenMP flags
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Apr 30, 2024
1 parent 2a0117a commit 7fd4065
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions recipes/pcl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,8 @@ def requirements(self):
if self._is_enabled("zlib"):
self.requires("zlib/[>=1.2.11 <2]")
if self._is_enabled("openmp"):
if self._is_enabled("openmp"):
if self.settings.compiler in ["clang", "apple-clang"]:
self.requires("llvm-openmp/17.0.4", transitive_headers=True, transitive_libs=True)
else:
self.output.info("Using system OpenMP")
if self.settings.compiler in ["clang", "apple-clang"]:
self.requires("llvm-openmp/17.0.4", transitive_headers=True, transitive_libs=True)
# TODO:
# self.requires("vtk/9.x.x", transitive_headers=True)
# self.requires("openni/x.x.x", transitive_headers=True)
Expand Down Expand Up @@ -501,6 +498,7 @@ def generate(self):
tc.generate()

deps = CMakeDeps(self)
deps.set_property("eigen", "cmake_file_name", "EIGEN")
deps.set_property("flann", "cmake_file_name", "FLANN")
deps.set_property("flann", "cmake_target_name", "FLANN::FLANN")
deps.set_property("libpcap", "cmake_file_name", "PCAP")
Expand All @@ -513,10 +511,10 @@ def generate(self):

def _patch_sources(self):
apply_conandata_patches(self)
packages = ["Eigen", "FLANN", "GLEW", "Pcap", "Qhull", "libusb"]
if Version(self.version) >= "1.14.0":
packages.remove("Eigen")
for mod in packages:
find_modules_to_remove = ["FLANN", "GLEW", "Pcap", "Qhull", "libusb"]
if Version(self.version) < "1.14.0":
find_modules_to_remove.append("Eigen")
for mod in find_modules_to_remove:
os.remove(os.path.join(self.source_folder, "cmake", "Modules", f"Find{mod}.cmake"))

def build(self):
Expand Down Expand Up @@ -606,13 +604,6 @@ def package_info(self):
openmp_flags = ["/Qopenmp"] if self.settings.os == "Windows" else ["-Qopenmp"]
self.cpp_info.cflags += openmp_flags
self.cpp_info.cxxflags += openmp_flags
self.cpp_info.sharedlinkflags += openmp_flags
self.cpp_info.exelinkflags += openmp_flags
if self.settings.os == "Windows":
if is_msvc(self):
self.cpp_info.system_libs.append("delayimp")
elif self.settings.compiler == "gcc":
self.cpp_info.system_libs.append("gomp")

# TODO: Legacy, to be removed on Conan 2.0
self.cpp_info.names["cmake_find_package"] = "PCL"
Expand Down

0 comments on commit 7fd4065

Please sign in to comment.