You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-31Lines changed: 40 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -17,42 +17,49 @@ Details may change every now and then anyway.
17
17
## CMake
18
18
19
19
A native plugin is a [Qt Plugin](https://doc.qt.io/qt-6/plugins-howto.html#the-low-level-api-extending-qt-applications), i.e. a shared library providing a particular interface.
20
-
To build such a library you have to define CMake targets and create an appropiate metadata file.
21
-
The [CMake module](https://raw.githubusercontent.com/albertlauncher/albert/master/cmake/albert-macros.cmake)provides convenience macros for this purpose.
22
-
You should probably skim through this module once.
23
-
The `albert_plugin` macro should be sufficient for most trivial plugins:
20
+
Albert uses CMake and provides convenient macros, most notably the `albert_plugin` macro, you can utilize to get started without having to write a lot of CMake boilerplate code.
21
+
Read the documentation header of the [CMake module](https://raw.githubusercontent.com/albertlauncher/albert/master/cmake/albert-macros.cmake)before you proceed.
22
+
23
+
This basic CMakeLists.txt is sufficient to build a basic plugin without dependencies and translations:
24
24
25
25
```cmake
26
-
albert_plugin (
27
-
NAME name
28
-
DESCRIPTION description
29
-
LICENSE licencse
30
-
URL url
31
-
[LONG_DESCRIPTION long_description]
32
-
[FRONTEND]
33
-
[MAINTAINERS ...]
34
-
[QT_DEPENDENCIES ...]
35
-
[LIB_DEPENDENCIES ...]
36
-
[EXEC_DEPENDENCIES ...]
26
+
project(my_plugin VERSION 1.0)
27
+
albert_plugin(
28
+
SOURCE_FILES
29
+
src/*
37
30
)
38
31
```
39
32
33
+
Unless you specify `METADATA` in the `albert_plugin` macro, a metadata file is expected to be found at `metadata.json`.
34
+
35
+
Supported metadata keys:
36
+
40
37
41
-
| Parameter | Type | Notes |
42
-
|------------------:|:------:|---|
43
-
|NAME | value | Human readable name.|
44
-
|DESCRIPTION | value | Brief, imperative description, e.g. "Open files".|
45
-
|LICENSE | value |Short form, e.g. BSD-2-Clause or GPL-3.0.|
46
-
| URL | value | Browsable online source, issues etc.|
47
-
|LONG_DESCRIPTION | value | Longer description or absolute file path to a text file (supports Markdown).|
48
-
|MAINTAINERS |list | A list of active maintainers. Preferrably using mentionable GitHub usernames.|
49
-
|QT_DEPENDENCIES | list | Qt dependencies to import and link. Qt::Core is in the public interface of libalbert. |
50
-
| LIB_DEPENDENCIES | list | Required libraries. Displayed to the user.|
51
-
|EXEC_DEPENDENCIES | list | Required executables. Displayed to the user.|
52
-
|FRONTEND | option | Indicates that this plugin implements the frontend interface.|
53
-
|NOUNLOAD | option | Prohibits unloading at runtime.|
0 commit comments