Skip to content

Commit

Permalink
conanfile.py: fix imgui backend copying
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Feb 23, 2024
1 parent 15d0e03 commit 1cb62ee
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def package_id(self):
for module in self._enabled_modules:
setattr(self.info.options, module, True)

def layout(self):
cmake_layout(self)

def requirements(self):
self._export_local_recipes()

Expand Down Expand Up @@ -159,8 +162,20 @@ def build_requirements(self):
self.tool_requires("cmake/[>=3.24]")
self.test_requires("gtest/1.14.0")

def layout(self):
cmake_layout(self)
def _copy_imgui_backends(self):
# The imgui backends are not built by default and need to be copied to the source tree
backends_dir = Path(self.dependencies["imgui"].package_folder) / "res" / "bindings"
output_dir = self.source_path.joinpath(
"src", "cupoch", "visualization", "visualizer", "imgui", "backends"
)
for backend_file in [
"imgui_impl_glfw.h",
"imgui_impl_glfw.cpp",
"imgui_impl_opengl3.h",
"imgui_impl_opengl3_loader.h",
"imgui_impl_opengl3.cpp",
]:
copy(self, backend_file, backends_dir, output_dir)

def generate(self):
VirtualBuildEnv(self).generate()
Expand All @@ -183,24 +198,10 @@ def generate(self):
deps.check_components_exist = True
deps.generate()

def _copy_imgui_backends(self):
# The imgui backends are not built by default and need to be copied to the source tree
backends_dir = Path(self.dependencies["imgui"].package_folder) / "res" / "bindings"
output_dir = self.source_path.joinpath(
"src", "cupoch", "visualization", "visualizer", "imgui", "backends"
)
for backend_file in [
"imgui_impl_glfw.h",
"imgui_impl_glfw.cpp",
"imgui_impl_opengl3.h",
"imgui_impl_opengl3_loader.h",
"imgui_impl_opengl3.cpp",
]:
copy(self, backend_file, backends_dir, output_dir)

def build(self):
if "visualization" in self._enabled_modules:
self._copy_imgui_backends()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down

0 comments on commit 1cb62ee

Please sign in to comment.