0

I' am currently attempting to build my own small graphical library that also uses imgui internally and want to distribute this single static library (/MT for release and /MTd for dbg).

How would I fully link imgui to my lib so that when I link my library to an application so that I don't have to link imgui against the executable too.

So basically I would like to bundle my library (which relies on imgui) and imgui into a single lib.

Currently I am just using target_link_libraries() like so:

# Set targets
add_library(final_lib STATIC ........cpp)

# Add dependencies
find_package(fmt CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)

target_link_libraries(final_lib PUBLIC fmt::fmt imgui::imgui)

Is there a way to bundle fmt, imgui into final_lib ?

Regards Artur

Artur K.
  • 599
  • 1
  • 6
  • 11
  • 1
    If you have `fmt` and `imgui` as static libraries, then see [that question](https://stackoverflow.com/questions/60190374/how-to-bundle-multiple-static-libraries-into-single-library-in-cmake-for-windows) about combining them and your library into the single static library. If you have `fmt` and `imgui` as shared libraries, then you cannot merge them. – Tsyvarev Dec 14 '21 at 17:35
  • @Tsyvarev Thanks for the answer worked perfectly – Artur K. Dec 15 '21 at 16:57

0 Answers0