This method requires you to first build and install TLed on your system. Your own project will then find and use this installed version.
First, clone the repository and run the standard CMake installation commands.
# 1. Clone the repository
git clone {repo-url}
cd your-repo
# 2. Configure the build
# CMAKE_INSTALL_PREFIX specifies where the library will be installed.
# Choose a local directory to avoid needing admin privileges.
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./install
# 3. Build the project
cmake --build build
# 4. Install the project
cmake --install buildAfter these steps, the install directory will contain all the necessary CMake configuration files.
In your project’s CMakeLists.txt, you can now find and link against TLed.
# Find the package.
# CMake needs to be told where to look for the installed files.
find_package(TLed PATHS "/path/to/install/lib/cmake/TLed" REQUIRED)When you successfully integrate TLed, the following CMake target and variables will be available to link against:
TLed::libtled-
The main library target. Link against this to use the core functionality.
TLED_QML_DIR-
The installation path for the QML module
|
Note
|
If your IDE reports "QML module not found", you can add the installation path to QML_IMPORT_PATH. set(QML_IMPORT_PATH ${TLED_QML_DIR} CACHE STRING "import led" FORCE) |
|
Note
|
At runtime, if the QML engine cannot find the module, you can add the installation path to the QML2_IMPORT_PATH environment variable. |
