diff --git a/src/linux/CMakeLists.txt b/src/linux/CMakeLists.txt index 0b485765..30398a48 100644 --- a/src/linux/CMakeLists.txt +++ b/src/linux/CMakeLists.txt @@ -1,5 +1,11 @@ -find_package(sdbus-c++ CONFIG REQUIRED) +find_package(sdbus-c++ REQUIRED) + +# The d-bus vcpkg port fails to export the libsystemd dependency properly via an imported target which causes the build +# to fail. This is a workaround to fix that by finding the libsystemd dependency via pkg-config and defining a global +# imported target. +include(FindPkgConfig) +pkg_check_modules(Systemd REQUIRED IMPORTED_TARGET GLOBAL libsystemd) add_subdirectory(external) add_subdirectory(libnl-helpers) diff --git a/src/linux/server/CMakeLists.txt b/src/linux/server/CMakeLists.txt index 5f372862..d8fccdf3 100644 --- a/src/linux/server/CMakeLists.txt +++ b/src/linux/server/CMakeLists.txt @@ -15,6 +15,7 @@ target_link_libraries(${PROJECT_NAME}-server-linux logging-utils notstd plog::plog + SDBusCpp::sdbus-c++ wifi-apmanager-linux wifi-core-linux ) diff --git a/vcpkg.json b/vcpkg.json index d91b7035..eddc86d0 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,6 +7,10 @@ "name": "sdbus-cpp", "platform": "linux" }, + { + "name": "libsystemd", + "platform": "linux" + }, "grpc", "cli11", "protobuf",