Search code examples
c++compilationconanbuild-systemmeson-build

How to access the files in the res folder in the imgui conan package?


I am using conan to handle dependencies, for those of you familiar with imgui, it provides a series of backends you can include.

When you look at the conan package these are found in the res folder.

I need to tell meson to include files in that directory, how do I instruct meson how to find these files?


Solution

  • I am new to conan so i dont know if there is a better solution, but i have the following in my conanfile.txt

    [imports]
    res, *glfw.* -> .
    

    which puts a bindings folder with the header and the source file in the build directory

    then i use them in my CMakeLists.txt with
    "${CMAKE_CURRENT_BINARY_DIR}/bindings/imgui_impl_glfw.cpp"

    In a .py script one would do somehting like the following:

      def imports(self):
            self.copy("*.cpp", dst="ext/imgui", src=self.deps_cpp_info["imgui"].resdirs[0])
            self.copy("*.hpp", dst="ext/imgui", src=self.deps_cpp_info["imgui"].resdirs[0])
            self.copy("*.h", dst="ext/imgui", src=self.deps_cpp_info["imgui"].resdirs[0])