0

I'm trying to get imgui working with OpenGL, using Conan to manage my dependencies. Imgui has backends which are used to hook into whatever rendering solution you're using.

The link below describes how to make those available to your project using Conan, by using the [imports] section of the conanfile.txt.

https://blog.conan.io/2019/06/26/An-introduction-to-the-Dear-ImGui-library.html

The imports() function has been removed from Conan 2.0, and I've seen some documentation saying you now need to use the generate() function in a conanfile.py to do the same thing. What I'd like to know is how to convert:

   [imports]
    ./misc/bindings, imgui_impl_glfw.cpp -> ../bindings
    ./misc/bindings, imgui_impl_opengl3.cpp -> ../bindings
    ./misc/bindings, imgui_impl_glfw.h -> ../bindings
    ./misc/bindings, imgui_impl_opengl3.h -> ../bindings

into what I need in the generates() function.

I haven't tried much yet, because I'm not sure where to start.

Chris
  • 76
  • 6

1 Answers1

1

The replacements of the legacy [imports] and imports() is an explicit copy() in the generate() method of the conanfile.py.

from conan.tools.files import copy

def generate(self):
    for dep in self.dependencies.values():
        copy(self, "*.dylib", dep.cpp_info.libdirs[0], self.build_folder)
        copy(self, "*.dll", dep.cpp_info.libdirs[0], self.build_folder)

More info in the migration guide of the docs

drodri
  • 5,157
  • 15
  • 21