-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists_qt5.txt
56 lines (51 loc) · 2.13 KB
/
CMakeLists_qt5.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
cmake_minimum_required(VERSION 3.15)
set(CMAKE_AUTOMOC ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Qml Quick)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Qml Quick)
find_package(QT NAMES Qt6 Qt5 OPTIONAL_COMPONENTS DBus)
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS DBus)
if (Qt6_FOUND)
find_package(Qt6 REQUIRED COMPONENTS StateMachine)
endif()
add_library(lqtutils STATIC
${CMAKE_CURRENT_LIST_DIR}/lqtutils_ui.cpp ${CMAKE_CURRENT_LIST_DIR}/lqtutils_ui.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_net.cpp ${CMAKE_CURRENT_LIST_DIR}/lqtutils_net.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_freq.cpp ${CMAKE_CURRENT_LIST_DIR}/lqtutils_freq.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_fsm.cpp ${CMAKE_CURRENT_LIST_DIR}/lqtutils_fsm.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_autoexec.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_bqueue.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_data.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_enum.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_logging.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_math.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_misc.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_perf.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_prop.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_settings.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_string.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_qsl.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_system.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_threading.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_time.h
)
if (IOS)
target_sources(lqtutils PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lqtutils_ui.mm)
endif()
if (ENABLE_FONT_AWESOME)
add_compile_definitions(LQT_FONT_AWESOME_ENABLED)
target_sources(lqtutils PRIVATE
${CMAKE_CURRENT_LIST_DIR}/lqtutils_fa.cpp ${CMAKE_CURRENT_LIST_DIR}/lqtutils_fa.h
${CMAKE_CURRENT_LIST_DIR}/lqtutils_fa.qrc
)
endif()
target_include_directories(lqtutils
PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(lqtutils PRIVATE
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Quick
)
if (Qt5DBus_FOUND)
target_link_libraries(lqtutils PRIVATE Qt5::DBus)
endif()