forked from basysKom/RiveQtQuickPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
57 lines (43 loc) · 1.76 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#[[
SPDX-FileCopyrightText: 2023 Jeremias Bosch <[email protected]>
SPDX-FileCopyrightText: 2023 Jonas Kalinka <[email protected]>
SPDX-FileCopyrightText: 2023 basysKom GmbH
SPDX-License-Identifier: LGPL-3.0-or-later
]]
cmake_minimum_required(VERSION 3.16)
project(RiveQtQuickPlugin
VERSION 0.1.0.0
DESCRIPTION "Cross-platform rive animation renderer for Qt Quick."
HOMEPAGE_URL "https://github.com/basysKom/RiveQtQuickPlugin"
LANGUAGES CXX
)
option(RQQRP_BUILD_EXAMPLES "Build demo applications." ON)
option(RQQRP_DOWNLOAD_BUILD_DEPENDENCIES "Downloads and Builds dependencies." ON)
# Set up Qt configuration and enable C++17
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Qt package
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Qml Quick OpenGL )
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Qml Gui Quick OpenGL)
if (${QT_VERSION_MAJOR} EQUAL 6)
# TODO use new policy
# https://doc.qt.io/qt-6/qt-cmake-policy-qtp0001.html
qt_policy(SET QTP0001 OLD)
endif()
add_compile_options(-gdwarf-4)
# Add rive-cpp dependency if required
if(${RQQRP_DOWNLOAD_BUILD_DEPENDENCIES})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/rive/cmake)
endif()
set(PLUGIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/RiveQtQuickItem)
add_subdirectory(${PLUGIN_SOURCE_DIR})
# Build examples if enabled
if(RQQRP_BUILD_EXAMPLES)
set(EXAMPLES_BINARY_DIR "${CMAKE_BINARY_DIR}/binary/examples" CACHE PATH "Binary directory for examples")
set(PLUGIN_TARGET_PATH "${CMAKE_BINARY_DIR}/binary/${PROJECT_NAME}/")
add_subdirectory(examples)
endif()