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

imguizmo: add compatibility with latest imgui versions #23435

Merged
merged 2 commits into from
Apr 11, 2024
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
13 changes: 10 additions & 3 deletions recipes/imguizmo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get
from conan.tools.files import copy, get, replace_in_file
from conan.tools.scm import Version

required_conan_version = ">=1.53.0"

Expand Down Expand Up @@ -42,20 +43,26 @@ def layout(self):

def requirements(self):
# 1.89 is the newest imgui version compatible with imguizmo
self.requires("imgui/1.89.3", transitive_headers=True)
self.requires("imgui/1.90.4", transitive_headers=True)

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

def generate(self):
tc = CMakeToolchain(self)
tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = ""
tc.generate()
tc = CMakeDeps(self)
tc.generate()

def build(self):
if Version(self.dependencies["imgui"].ref.version) >= "1.89.4":
# Related to a breaking change: https://github.com/ocornut/imgui/blob/master/docs/CHANGELOG.txt#L912
# Redirection: ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic()
replace_in_file(self, os.path.join(self.source_folder, "GraphEditor.cpp"),
franramirez688 marked this conversation as resolved.
Show resolved Hide resolved
"AddBezierCurve", "AddBezierCubic")
cmake = CMake(self)
cmake.configure(build_script_folder=self.export_sources_folder)
cmake.configure(build_script_folder=self.source_path.parent)
cmake.build()

def package(self):
Expand Down
Loading