hugoam/kiui

Lack of documentation on adding kiui to larger cmake project.

Tarinaky opened this issue · 4 comments

Attempting something similar to the following (on a Windows version of cmake):
add_subdirectory(glfw-3.1.1)
add_subdirectory(kiui)
...
target_link_libraries(foo kiui ${OPENGL_LIBRARIES} glfw)

resulting in unresolved external symbols from glfw when trying to build kiui.dll. Have tried to force kiui to build statically, however it keeps failing trying to build kiui.dll.

I was not having this problem when using imgui+glfw, so I think there's something that may need to be improved with KiUi's build process.

Does imgui depends on glfw ?
What did kiui CMake process say about finding glfw ?
There lack an option for a static build, but this pull request has added it : #21

kiUi build process is far from perfect : I learned CMake as I was writing it, so it should get better, with your help, eventually

Sorry I've not been able to reply to this as quickly as I'd have liked.

IMGUI does not directly depend on glfw, however the examples for imgui comes with a glfw bindings, which I'm using.

I will have a gist test-case online asap :)

Okay, thanks for the test sample.
I know the problem, but I'm not sure of the appropriate fix.
The kiui script uses the GLFW_LIBRARIES variable to link the glfw lib, which is usually set by a FIND_PACKAGE() command. Since you are directly adding glfw as a directory, I suppose this variable is never set.

Also, I'm gonna make a change soon where kiui.lib will just contain the UI lib and kiui_glfw.lib will contain the frontend (and the dependency on glfw). This will just move the 'problem' to kiui_glfw, but just letting you know.