jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
374 stars 33 forks source link

Cmake error during building : "Targets not yet defined: Qt::CorePrivate" #188

Closed nowhere-girl closed 2 years ago

nowhere-girl commented 2 years ago
SYSTEM : Ubuntu 22.04 (Jammy Jellyfish)
KERNEL : 5.15.0-41-generic
CMAKE : cmake version 3.22.1
QMAKE : Qmake version 3.1
GCC : gcc version 11.2.0
QT : Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu

After checking all QT and QML dependencies, then following building instructions :

    git clone https://github.com/jahnf/Projecteur
    cd Projecteur
    mkdir build && cd build
    cmake ..
    make

Errors encountered during cmake ..

Screenshot from 2022-07-29 19-43-56

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreVersionlessTargets.cmake:37 (message):
  Some (but not all) targets in this export set were already defined.

  Targets Defined: Qt::Core

  Targets not yet defined: Qt::CorePrivate

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreConfig.cmake:63 (include)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:219 (find_package)
  CMakeLists.txt:44 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/aleksandr/Projecteur/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log is attached below : CMakeOutput.log

How should I approach from here ?

jahnf commented 2 years ago

Hi, looks like CMake is finding and using Qt6 instead of Qt5 (see your posted call stack)

You can try to set the PROJECTEUR_QT_VERSION CMake option to 5 instead of Auto (the default):

mkdir build && cd build
cmake .. -DPROJECTEUR_QT_VERSION=5
make
nowhere-girl commented 2 years ago

Thank you @jahnf, it worked. I could install Projecteur and was able to copy the generated udev rule to my system. In case someone else encounters the same problem as me, I want to add that the tray indicator was missing on my system and both GNOME extensions suggested to install from README.md are no longer exist. In the end I went with "sudo apt install projecteur" and everything was done quickly, the tray icon was available right away.

Since everything is resolved, I will close this thread. Thanks again @jahnf for providing such a helpful tool.