From 24fc6bd749bc70380eb52c63cd9dbe83deb3ea89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Fri, 25 Oct 2024 00:29:45 +0300 Subject: [PATCH] Optionally support system libe131 Can be enabled by calling qmake with CONFIG+=system_libe131. Includes comments for general structure to handle in-tree vs. out-of-tree dependencies. Handles only systems who use pkgconfig. --- OpenRGB.pro | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/OpenRGB.pro b/OpenRGB.pro index 043fc32a..3aa398cd 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -108,7 +108,6 @@ INCLUDEPATH += dependencies/hueplusplus-1.1.0/include/hueplusplus \ dependencies/httplib \ dependencies/json/ \ - dependencies/libe131/src/ \ dependencies/mdns \ dmiinfo/ \ hidapi_wrapper/ \ @@ -197,7 +196,6 @@ SOURCES += dependencies/hueplusplus-1.1.0/src/UPnP.cpp \ dependencies/hueplusplus-1.1.0/src/Utils.cpp \ dependencies/hueplusplus-1.1.0/src/ZLLSensors.cpp \ - dependencies/libe131/src/e131.c \ main.cpp \ cli.cpp \ dmiinfo/dmiinfo.cpp \ @@ -228,6 +226,25 @@ SOURCES += RESOURCES += \ qt/resources.qrc \ +#-----------------------------------------------------------------------------------------------# +# General configuration to decide if in-tree dependencies are used or not +#-----------------------------------------------------------------------------------------------# + +!system_libe131:SOURCES += dependencies/libe131/src/e131.c +!system_libe131:INCLUDEPATH += dependencies/libe131/src/ + +#-----------------------------------------------------------------------------------------------# +# General configuration out-of-tree dependencies if in-tree are not used for systems +# who use pkg-config i.e. Unix-like. Also includes macOS as Homebrew uses pkg-config too. +#-----------------------------------------------------------------------------------------------# + +unix { + system_libe131 { + CONFIG += link_pkgconfig + PKGCONFIG += libe131 + } +} + #-----------------------------------------------------------------------------------------------# # Translations # # NB: Translation files should not be added dynamically due to the process #