DISTRHO / DPF

DISTRHO Plugin Framework
ISC License
672 stars 97 forks source link

[CMake] Possibility to link custom libraries (statically) #439

Closed relascope closed 1 year ago

relascope commented 1 year ago

target_link_libraries and dpf__add_static_library looked good, but won't work, when placed before or after, because all linking has to be in one CMake target_link_libraries.
DPF/cmake/DPF-plugin.cmake could be edited, but I prefer not to change code in submodules...

falkTX commented 1 year ago

who says that? In https://github.com/DISTRHO/elements-template-plugin/blob/main/CMakeLists.txt I add extra libraries to link without issues, so it for sure works (and CI builds prove it also works for linux, mac and windows too).

AnClark commented 1 year ago

but won't work, when placed before or after,

What happened? Linker error, or other problems?

I agree with falkTX. I use CMake too, and my projects usually link against 3rd-party libraries. Everything should works well.

You can refer to my project Minaton-XT. It links against 2 external libraries statically.

relascope commented 1 year ago

Sorry, it works. I forgot to specify PRIVATE|PUBLIC.