using external Libraries

Hi,
i have a project with a lot of external lib (Windows; dll files).
I have build for every Library (most of the libraries have many dll) a Config.cmake file, with a component for every .dll and in the projects and subprojects i link again the component.
It this the correct way to integrate external .dll files (we have only binaries)???
And how is it intended if a component need another component?
e.g. I have MyLib which a base_component, first_component and second_component.
How can i handle it that the base_component is every time linked against first_component?
Do have anyone an example for it?

Bests

Brian

Hello,

Please note I am not an expert. Maybe I’ll tell you bullshits.

I think the DLL should be put in the package, but you’ll ahve to define two kinds of targets:

  • targets to link to (.lib)
  • targets to copy (.dll)

and document them.

In the CMakeLists.txt of your package, withe the compoents Core and Gui, do:

add_library(MyLibCore ...)
add_library(MyLibGu ...)

target_link_libraries(MyLibGui PUBLIC MyLibCore)

...

install(TARGETS ...
install(EXPORT ...)
configure_package_config_file(...)