-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (120 loc) · 3.78 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
129
130
131
132
133
134
cmake_minimum_required(VERSION 3.5)
project(GlassPlotter)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# If cmake raises "QT_DIR not found" error, set Qt install path explicitly.
# set(CMAKE_PREFIX_PATH "C:/Qt/(version)/(kit)")
find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport REQUIRED)
set(GLASSPLOTTER_SOURCES
src/qcustomtablewidget.cpp
src/global_settings_io.cpp
src/air.cpp
src/preference_dialog.cpp
src/catalog_view_form.cpp
src/catalog_view_setting_dialog.cpp
src/curve_fitting_dialog.cpp
src/dispersion_plot_form.cpp
src/dndt_plot_form.cpp
src/glass.cpp
src/glass_catalog.cpp
src/glass_catalog_manager.cpp
src/glass_datasheet_form.cpp
src/glass_selection_dialog.cpp
src/glass_search_form.cpp
src/glassmap_form.cpp
src/load_catalog_result_dialog.cpp
src/main.cpp
src/main_window.cpp
src/preset_dialog.cpp
src/property_plot_form.cpp
src/qcpscatterchart.cpp
src/spectral_line.cpp
src/transmittance_plot_form.cpp
${CMAKE_SOURCE_DIR}/3rdparty/QCustomPlot/qcustomplot.cpp
${CMAKE_SOURCE_DIR}/3rdparty/pugixml/src/pugixml.cpp
)
set(GLASSPLOTTER_HEADERS
src/qcustomtablewidget.h
src/global_settings_io.h
src/air.h
src/preference_dialog.h
src/catalog_view_form.h
src/catalog_view_setting_dialog.h
src/curve_fitting_dialog.h
src/dispersion_formula.h
src/dispersion_plot_form.h
src/dndt_plot_form.h
src/glass.h
src/glass_catalog.h
src/glass_catalog_manager.h
src/glass_datasheet_form.h
src/glass_selection_dialog.h
src/glass_search_form.h
src/glassmap_form.h
src/load_catalog_result_dialog.h
src/main_window.h
src/preset_dialog.h
src/property_plot_form.h
src/qcpscatterchart.h
src/spectral_line.h
src/transmittance_plot_form.h
3rdparty/QCustomPlot/qcustomplot.h
)
set(GLASSPLOTTER_FORMS
src/preference_dialog.ui
src/glassmap_form.ui
src/catalog_view_form.ui
src/catalog_view_setting_dialog.ui
src/curve_fitting_dialog.ui
src/dispersion_plot_form.ui
src/dndt_plot_form.ui
src/glass_datasheet_form.ui
src/glass_selection_dialog.ui
src/glass_search_form.ui
src/load_catalog_result_dialog.ui
src/main_window.ui
src/preset_dialog.ui
src/transmittance_plot_form.ui
)
if(WIN32)
set(APP_ICON_WIN32_RESOURCE "${CMAKE_SOURCE_DIR}/resource.rc")
add_executable(${PROJECT_NAME}
${GLASSPLOTTER_SOURCES}
${GLASSPLOTTER_HEADERS}
${GLASSPLOTTER_FORMS}
${APP_ICON_WIN32_RESOURCE} )
else(APPLE)
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
# generated by CMake. This variable contains the .icns file name,
# without the path.
set(MACOSX_BUNDLE_ICON_FILE GlassPlotterIcon.icns)
# And the following tells CMake where to find and install the file itself.
set(APP_ICON_MACOS "${CMAKE_SOURCE_DIR}/data/icon/GlassPlotterIcon.icns")
set_source_files_properties(${APP_ICON_MACOS} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
add_executable(${PROJECT_NAME} MACOSX_BUNDLE
${GLASSPLOTTER_SOURCES}
${GLASSPLOTTER_HEADERS}
${GLASSPLOTTER_FORMS}
${APP_ICON_MACOS})
endif(WIN32)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/3rdparty
${CMAKE_SOURCE_DIR}/3rdparty/QCustomPlot
${CMAKE_SOURCE_DIR}/3rdparty/spline/src
${CMAKE_SOURCE_DIR}/3rdparty/pugixml/src
)
target_link_libraries(${PROJECT_NAME} PUBLIC
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::PrintSupport
)
# surpress console window
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()