-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
128 lines (108 loc) · 3.61 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
cmake_minimum_required(VERSION 3.5)
project(ddiview VERSION 0.1 LANGUAGES C CXX)
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_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets PrintSupport)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets PrintSupport)
add_subdirectory(thirdparty/ciglet)
set(PROJECT_SOURCES
main.cpp
common.h
common.cpp
ui/uicommon.h
ui/uicommon.cpp
ui/mainwindow.cpp
ui/mainwindow.h
ui/mainwindow.ui
ui/statisticsresultdialog.h
ui/statisticsresultdialog.cpp
ui/statisticsresultdialog.ui
ui/articulationtabledialog.h
ui/articulationtabledialog.cpp
ui/articulationtabledialog.ui
ui/ddiexportjsonoptionsdialog.h
ui/ddiexportjsonoptionsdialog.cpp
ui/ddiexportjsonoptionsdialog.ui
ui/mediatoolwindow.h
ui/mediatoolwindow.cpp
ui/mediatoolwindow.ui
ui/propertycontextmenu.h
ui/propertycontextmenu.cpp
parser/ddi.cpp
parser/ddi.h
util/util.h
util/util.cpp
chunk/propertytype.h
chunk/propertytype.cpp
chunk/chunkcreator.h
chunk/chunkcreator.cpp
chunk/basechunk.h
chunk/chunkarray.h
chunk/dbsinger.h
chunk/phonemedict.h
chunk/phonemegroup.h
chunk/emptychunk.h
chunk/dbvoice.h
chunk/dbvarticulation.h
chunk/dbvarticulationphu.h
chunk/dbvarticulationphupart.h
chunk/dbvstationary.h
chunk/dbvstationaryphu.h
chunk/dbvstationaryphupart.h
chunk/dbvvqmorph.h
chunk/dbvvqmorphphu.h
chunk/dbvvqmorphphupart.h
chunk/dbtimbre.h
chunk/dbtimbremodel.h
chunk/item_phoneticunit.h
chunk/item_directory.h
chunk/item_phonemegroup.h
chunk/item_groupedphoneme.h
chunk/item_eprguides.h
chunk/item_articulationsection.h
chunk/item_audioframerefs.h
)
# QCustomPlot
add_library(qcustomplot STATIC thirdparty/qcustomplot/qcustomplot.cpp)
target_include_directories(qcustomplot PUBLIC thirdparty/qcustomplot)
target_link_libraries(qcustomplot Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(ddiview
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET ddiview APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
if(ANDROID)
add_library(ddiview SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(ddiview
${PROJECT_SOURCES}
)
endif()
endif()
target_link_libraries(ddiview PRIVATE Qt${QT_VERSION_MAJOR}::Widgets qcustomplot ciglet)
set_target_properties(ddiview PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
install(TARGETS ddiview
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(ddiview)
endif()