Skip to content

Commit 52280c2

Browse files
committed
Add USE_SYSTEM_SDBUS_CPP_LIBS option
1 parent 6779fdf commit 52280c2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ SET ( DEFAULT_PROTOBUF ON )
3434
SET ( DEFAULT_WS281XPWM OFF )
3535
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS ON )
3636
SET ( DEFAULT_USE_SYSTEM_MQTT_LIBS OFF )
37+
SET ( DEFAULT_USE_SYSTEM_SDBUS_CPP_LIBS ON )
3738
SET ( DEFAULT_MF OFF )
3839
SET ( DEFAULT_DX OFF )
3940
SET ( DEFAULT_AVF OFF )
@@ -513,6 +514,9 @@ colorMe("USE_SYSTEM_MQTT_LIBS = " ${USE_SYSTEM_MQTT_LIBS})
513514
option(USE_SYSTEM_FLATBUFFERS_LIBS "Use system flatbuffers libs" ${DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS})
514515
colorMe("USE_SYSTEM_FLATBUFFERS_LIBS = " ${USE_SYSTEM_FLATBUFFERS_LIBS})
515516

517+
option(USE_SYSTEM_SDBUS_CPP_LIBS "Use system sdbus-c++ libs" ${DEFAULT_USE_SYSTEM_SDBUS_CPP_LIBS})
518+
colorMe("USE_SYSTEM_SDBUS_CPP_LIBS = " ${USE_SYSTEM_SDBUS_CPP_LIBS})
519+
516520
option(USE_STATIC_QT_PLUGINS "Enable static QT plugins" ${DEFAULT_STATIC_QT_PLUGINS})
517521
colorMe("USE_STATIC_QT_PLUGINS = " ${USE_STATIC_QT_PLUGINS})
518522

external/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,21 @@ ENDIF()
262262
#=============================================================================
263263

264264
if (UNIX AND NOT APPLE AND (ENABLE_POWER_MANAGEMENT OR ENABLE_PIPEWIRE))
265+
if (USE_SYSTEM_SDBUS_CPP_LIBS)
266+
pkg_check_modules (sdbus-c++ sdbus-c++>=2.0.0)
267+
268+
if(NOT sdbus-c++_FOUND)
269+
message( WARNING "Could not find: sdbus-c++>=2.0.0. Fallback to sdbus-c++ submodule." )
270+
else()
271+
#add_library(sdbus-cpp ALIAS libzstd)
272+
endif()
273+
endif()
274+
275+
if(NOT sdbus-c++_FOUND)
265276
set(SDBUSCPP_BUILD_DOCS OFF CACHE BOOL "No doc")
266277
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sdbus-cpp)
267278
set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ON)
279+
endif()
268280
endif()
269281

270282
#=============================================================================

0 commit comments

Comments
 (0)