lirios / shell

:shell: Convergent shell for desktops, phones and tables built with QtQuick, Wayland and Material Design
GNU General Public License v3.0
232 stars 15 forks source link

Getting a cmake error building, need a small fix to get it to work #221

Closed n3rdopolis closed 2 years ago

n3rdopolis commented 2 years ago

Hi I seem to get this error with cmake,

CMake Error at /opt/share/LiriCMakeShared/modules/LiriAddQmlPlugin.cmake:70 (add_library):
  Target "LiriShellCompositorQmlPlugin" links to target
  "Liri::AuroraCompositor" but the target was not found.  Perhaps a
  find_package() call is missing for an IMPORTED target, or an ALIAS target
  is missing?
Call Stack (most recent call first):
  src/imports/compositor/CMakeLists.txt:5 (liri_add_qml_plugin)

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

applying this gets it to work

diff --git a/src/imports/compositor/CMakeLists.txt b/src/imports/compositor/CMakeLists.txt
index a5fbabc7..03b8fcd5 100644
--- a/src/imports/compositor/CMakeLists.txt
+++ b/src/imports/compositor/CMakeLists.txt
@@ -2,6 +2,10 @@
 #
 # SPDX-License-Identifier: BSD-3-Clause

+if(NOT TARGET Liri::AuroraCompositor)
+    find_package(Liri1AuroraCompositor REQUIRED)
+endif()
+
 liri_add_qml_plugin(LiriShellCompositorQmlPlugin
     MODULE_PATH
         "Liri/Shell/Compositor"