ggerganov / imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
https://imtui.ggerganov.com
MIT License
2.94k stars 123 forks source link

Imtui doesn't compile due to imgui headers not being found #46

Open kamkow1 opened 1 year ago

kamkow1 commented 1 year ago

Hello, I'm trying to use Imtui in my Cmake project, but Imtui doesn't compile. here's the error:

[kamil@czarnepudlo build]$ cmake .. && make -j8
-- Configuring done
-- Generating done
-- Build files have been written to: /archive/ARCHIVE/sources/ce/build
[ 46%] Built target imgui-for-imtui
[ 53%] Built target ce_lib
[ 69%] Built target imtui
[ 76%] Building CXX object CMakeFiles/ce_exe.dir/source/main.cpp.o
Scanning dependencies of target imtui-ncurses
[ 84%] Building CXX object thirdparty/imtui/src/CMakeFiles/imtui-ncurses.dir/imtui-impl-ncurses.cpp.o
In file included from /archive/ARCHIVE/sources/ce/source/main.cpp:3:
/archive/ARCHIVE/sources/ce/thirdparty/imtui/include/imtui/imtui.h:8:10: fatal error: 'imgui/imgui.h' file not found
#include "imgui/imgui.h"
         ^~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ce_exe.dir/build.make:82: CMakeFiles/ce_exe.dir/source/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/ce_exe.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 92%] Linking CXX static library libimtui-ncurses.a
[ 92%] Built target imtui-ncurses
make: *** [Makefile:171: all] Error 2

Also, yes, I did clone the repo with --recursive so the imgui submodule is present in the third-party directory

ggerganov commented 1 year ago

Does it compile when you follow the instructions from the README? I think it should since the CI runs are successful. I guess the CMakeLists need some updates in order to be able to use them in other projects.

kamkow1 commented 1 year ago

Does it compile when you follow the instructions from the README? I think it should since the CI runs are successful. I guess the CMakeLists need some updates in order to be able to use them in other projects.

It works when I build it and install globally on my system. What I'm trying to do is use Imtui as a Cmake subdirectory inside of a project