diff --git a/CMakeLists.txt b/CMakeLists.txt index 283a6b3..456a293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,9 @@ if(BUILD_STATIC_DEPS) include(StaticBuild) add_subdirectory(external/loki-mq) else() - find_package(LokiMQ 1.2 REQUIRED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(lokimq REQUIRED liblokimq>=1.2.2 IMPORTED_TARGET) + add_library(lokimq::lokimq ALIAS PkgConfig::lokimq) endif() find_package(Qt5 COMPONENTS Qml Quick Widgets Charts Svg REQUIRED) @@ -56,7 +58,7 @@ add_executable(lokinet-gui target_link_libraries(lokinet-gui PRIVATE Qt5::Core Qt5::Qml Qt5::Quick Qt5::Widgets Qt5::Charts Qt5::Svg Threads::Threads - lokimq + lokimq::lokimq ) if (WIN32) diff --git a/cmake/FindLokiMQ.cmake b/cmake/FindLokiMQ.cmake deleted file mode 100644 index a191d47..0000000 --- a/cmake/FindLokiMQ.cmake +++ /dev/null @@ -1,21 +0,0 @@ -find_package(PkgConfig) -if (PKG_CONFIG_FOUND) - pkg_check_modules(PC_LOKIMQ QUIET liblokimq>=${LokiMQ_VERSION}) -endif() - -find_path(LOKIMQ_INCLUDE_DIR lokimq/lokimq.h - HINTS ${PC_LOKIMQ_INCLUDEDIR} ${PC_LOKIMQ_INCLUDE_DIRS}) - -find_library(LOKIMQ_LIBRARY NAMES lokimq - HINTS ${PC_LOKIMQ_LIBDIR} ${PC_LOKIMQ_LIBRARY_DIRS}) - -mark_as_advanced(LOKIMQ_INCLUDE_DIR LOKIMQ_LIBRARY) - -set(LOKIMQ_LIBRARIES ${LOKIMQ_LIBRARY} ${PC_LOKIMQ_LIBRARIES}) -set(LOKIMQ_INCLUDE_DIRS ${LOKIMQ_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LokiMQ DEFAULT_MSG - LOKIMQ_LIBRARY LOKIMQ_INCLUDE_DIR) - -mark_as_advanced(LOKIMQ_INCLUDE_DIR LOKIMQ_LIBRARY) diff --git a/external/loki-mq b/external/loki-mq index 95d7e09..e7487fd 160000 --- a/external/loki-mq +++ b/external/loki-mq @@ -1 +1 @@ -Subproject commit 95d7e0964f7af5a34960fa3da9d3eb1e1958de28 +Subproject commit e7487fd0c8ee843b3a3df16563ee42dad2fde050