It appears that users have trouble to relate failed PulseView builds to
missing dependencies during libsigrok configuration. Although the error
occurs early and is stated in the build output, it only gets noticed
late and users forgot about the earlier step, or never bothered to check.
Explicitly test for the availability of the C++ bindings, and print a
message that points to libsigrok's(!) configuration phase. Another
check for the full set of libraries will fail in fatal ways as before.
An unfortunate implementation detail of the cmake check leaves all parts
of the lookup result empty when either(!) of the tested libs is missing.
So we cannot tell with certainty which test failed when the test result
is negative while a list of libraries was passed to the test. That's why
the "soft" individual test with QUIET and without REQUIRED is the least
intrusive adjustment to existing CMake rules, where other locations
depend on the PKGDEPS_* variables.
This change addresses bug #1199.
list(APPEND PKGDEPS glib-2.0>=2.28.0)
list(APPEND PKGDEPS glibmm-2.4>=2.28.0)
-list(APPEND PKGDEPS libsigrokcxx>=0.6.0)
+set(LIBSR_CXX_BINDING "libsigrokcxx>=0.6.0")
+list(APPEND PKGDEPS "${LIBSR_CXX_BINDING}")
if(ENABLE_DECODE)
list(APPEND PKGDEPS libsigrokdecode>=0.6.0)
endif()
find_package(PkgConfig)
+pkg_check_modules(LIBSRCXX QUIET ${LIBSR_CXX_BINDING})
+if(NOT LIBSRCXX_FOUND OR NOT LIBSRCXX_VERSION)
+ message(FATAL_ERROR "libsigrok C++ bindings missing, check libsigrok's 'configure' output (missing dependencies?)")
+endif()
pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
set(CMAKE_AUTOMOC TRUE)