0

My question is primarily two parts:

I have tried to install Cimgui from their github page. I first clone the project and its subprojects like imgui as said in their page. Then, after running make and sudo cmake --install . --config Debug, It builds the project and it adds a cimgui.so file to my /usr/local/ directory. But, I can't figure out how to use it in my projects and specially how to use pkg-config for it. I guess, we are suppose to manually create .pc files but I am not sure how to do it.

Also, please let me know, how I can include it with meson. I know that in meson we can just use cmake but I am not completely sure how I should do it.

Thanks for your help.

demortz
  • 51
  • 7
  • 2
    Imgui doesn't seem to install `.pc` files, so it is not possible to use it via `pkg-config`. You need to use meson's machinery for locating headers and libraries. – arrowd Jul 16 '23 at 17:51
  • @arrowd I tried using meson with cmake but it needs cimgui.wrap. Would it be ok just to search for all `.h` and `.c` files to include them? – demortz Jul 16 '23 at 21:53
  • 1
    cmake is only needed to build `cimgui`. use meson's facilities to find it once it's been installed. you may be better served filing a [new issue](https://github.com/cimgui/cimgui/issues/new) asking for meson support – nega Jul 19 '23 at 04:01
  • Maybe [compiler.find_library()](https://mesonbuild.com/Reference-manual_returned_compiler.html#compilerfind_library) ? – droptop Jul 20 '23 at 15:54
  • @droptop Thanks, I did not know this. I will definitely try. – demortz Jul 20 '23 at 19:18
  • @nega I put the issue [here](https://github.com/cimgui/cimgui/issues/247) and there was a response which I do not understand! – demortz Jul 20 '23 at 19:18

1 Answers1

0

With cimgui.so in /usr/local this should work

cc = meson.get_compiler('c')
cimgui_dep = cc.find_library('cimgui', dirs: '/usr/local', required: true)
droptop
  • 1,372
  • 13
  • 24