-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
47 lines (37 loc) · 1.06 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
cmake_minimum_required(VERSION 3.14)
project(qdc6
VERSION 1.1
LANGUAGES CXX
)
option(SVG "Build with SVG support" OFF)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(qtComponents Gui)
if(SVG)
list(APPEND qtComponents Svg)
endif()
find_package(QT NAMES Qt6 Qt5 COMPONENTS ${qtComponents})
if(QT_FOUND)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${qtComponents} REQUIRED)
else()
set(qtComponentsUnprefixed ${qtComponents})
list(TRANSFORM qtComponents PREPEND Qt)
find_package(Qt4 REQUIRED ${qtComponents})
foreach(component IN ZIP_LISTS qtComponentsUnprefixed qtComponents)
add_library("Qt4::${component_0}" ALIAS "Qt4::${component_1}")
endforeach()
endif()
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_executable(qdc6
main.cpp
resources.qrc
)
target_link_libraries(qdc6 PRIVATE Qt${QT_VERSION_MAJOR}::Gui)
if(SVG)
add_compile_definitions(SVG_ENABLED=1)
target_link_libraries(qdc6 PRIVATE Qt${QT_VERSION_MAJOR}::Svg)
endif()