labstreaminglayer / App-LabRecorder

An application for streaming one or more LSL streams to disk in XDF file format.
MIT License
128 stars 45 forks source link

CMake error when using Qt5 on Debian #73

Closed jpwright closed 2 years ago

jpwright commented 3 years ago

I'm attempting to build LabRecorder on an arm64 device (Raspberry Pi 4 Model B Rev 1.4) running Debian 10, cmake 3.13.4, Qt 5.11.3.

I successfully built liblsl, but seems that CMake insists on searching for Qt6, even though it looks like there's some logic to fallback to Qt5 in CMakeLists.txt. Because there are no Qt6 packages for Debian, and I want to run LabRecorder "headless" anyway, it'd be nice to not have to wrangle a Qt6 installation if possible.

root@rpi4-20210210:~/git/App-LabRecorder/build# LSL_DIR=../../liblsl/build cmake -DCMAKE_PREFIX_PATH=/usr/lib/aarch64-linux-gnu/cmake/qt5 ..
-- Included LSL CMake helpers, rev. 15, /root/git/liblsl/build
CMake Warning at CMakeLists.txt:41 (find_package):
  By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt6", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt6" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake

  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
  to a directory containing one of the above files.  If "Qt6" provides a
  separate development package or SDK, be sure it has been installed.

CMake Error at /root/git/liblsl/build/LSLCMake.cmake:140 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "xdfwriter".
Call Stack (most recent call first):
  CMakeLists.txt:94 (installLSLApp)

-- Installing Components: LabRecorder
-- Configuring incomplete, errors occurred!
See also "/root/git/App-LabRecorder/build/CMakeFiles/CMakeOutput.log".
See also "/root/git/App-LabRecorder/build/CMakeFiles/CMakeError.log".
tstenner commented 2 years ago

The fallback to Qt5 seems to work, but CMake doesn't know where to install the xdfwriter library. I added it in https://github.com/sccn/liblsl/commit/b5c85a9b5caff92ce437e1642cf4e227141a4697, but unless you build against the liblsl head, it will be a while until you'll notice it. For now, you could change line 15 in xdfwriter/CMakeLists.txt to add_library(${PROJECT_NAME} SHARED xdfwriter.cpp).