Always use pkgconfig to search for lokimq

This simplifies FindLokiMQ, and lets us drop it entirely in favour of
two lines in CMakeLists.txt.

Also updates the required lokimq to 1.2.2 for the segfault-on-shutdown
fix.
This commit is contained in:
Jason Rhinelander 2020-11-17 14:15:33 -04:00
parent bd41600d3f
commit 186ed5a38b
3 changed files with 5 additions and 24 deletions

View File

@ -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)

View File

@ -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)

2
external/loki-mq vendored

@ -1 +1 @@
Subproject commit 95d7e0964f7af5a34960fa3da9d3eb1e1958de28
Subproject commit e7487fd0c8ee843b3a3df16563ee42dad2fde050