-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
169 lines (146 loc) · 5.6 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
cmake_minimum_required(VERSION 3.3.0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version")
file(READ src/version.h ver)
string(REGEX MATCH "MAJOR_VERSION ([0-9]*)" _ ${ver})
set(ver_major ${CMAKE_MATCH_1})
string(REGEX MATCH "MINOR_VERSION ([0-9]*)" _ ${ver})
set(ver_minor ${CMAKE_MATCH_1})
string(REGEX MATCH "PATCH_VERSION ([0-9]*)" _ ${ver})
set(ver_patch ${CMAKE_MATCH_1})
set(MR_WRITER_VERSION "${ver_major}.${ver_minor}.${ver_patch}")
project(MrWriter VERSION ${MR_WRITER_VERSION})
set (CMAKE_CXX_STANDARD 14)
set(CONAN_BUILD_INFO_FILE ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
if (EXISTS ${CONAN_BUILD_INFO_FILE})
include(${CONAN_BUILD_INFO_FILE})
conan_basic_setup(KEEP_RPATHS)
set(USE_CONAN TRUE)
else()
set(USE_CONAN FALSE)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
message(" -= MrWriter ${MR_WRITER_VERSION} =-")
message("0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0")
message(", ....';;;,'.. ,")
message(", .:dOXWXOk0NMMMMMMWx..;'. ,")
message(", .cOWMMMWXOkOXMMMMMMWx..ckkkkx' ,")
message(", c0MMMMWX0kk0NMMMMMMWd..lkkkkkc..cko, ,")
message(", .dWMMMWX0kk0XWMMMMMMWo..okkkkx: .lkkkkkx: ,")
message(", oWMMMWKkk0XWMMMMMMMNo .okkkkx; .okkkkkkkkkx; ,")
message(", 'XMMMMXkk0NMMMMMMMMNl .okkkkx; .okkkkkkkkkkkkko ,")
message(", :WMMMW0kONMMMMMMMMNc .',:dx, 'dkkkkkkkkkkkkkx; .' ,")
message(", lMMMMWOk0WMMMMMMMMo :xKXKOo. .dkkkkkkkkkkkkkx; 'okk, ,")
message(", ;MMMMMXkkWMMMMMMMMO oMMMMMMMMo :kkkkkkkkkkkx, 'dkkkkx ,")
message(", NMMMMMNkkWMMMMMMMN.'MMMMMMMMMM' kkkkkkkkkd, 'dkkkkd, : ,")
message(", lMMMMMMWOk0MMMMMMM; XMMMMMMMMMW..llloxkkd' ,dkkkkd' cXMl ,")
message(", 0MMMMMMMNkkNMMMMMx xMMMMMMMMMK. ,cll:... ;xkkkkd' lNMMM0 ,")
message(", WMMMMMMMMOkKMMMMX ;MMMMMMMMMMXkWMMMMMMK, okkko. lNMMMMMW ,")
message(", WMMMMMMMWkkXMMMW' 0WMMMMMMMMMMMMMMMMMMMM..ko..oNMMMMMMMW ,")
message(", KMMMMMMMXkkWMMMo '...;kWMMMMMMMMMMMMMMMM, ..dWMMMMMMMMMK ,")
message(", oMMMMMMWOkKMMMK 'kkkxl..xMMMMMMMMMMMMMMd .xWMMMMMMMMMMMo ,")
message(", .WMMMMMNkkNMMW. xkkkkkkl :MMMMMMMXko;..'kWMMMMMMMMMMMMW. ,")
message(", cMMMMMWkkXMMl okkkkkkkk: xKkl;..,cx0NMMMMMMMMMMMMMMMMc ,")
message(", dMMMMM0kOWO ;kkkkkxo:,. .;lkKWMMMMMMMMMMMMMMMMMMMMMd ,")
message(", oMMMMW0kk..dl:'...:oOXWMMMMMMMMMMMMMMMMMMMMMMMMMMo ,")
message(", ;NMMMW0, .':dONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN; ,")
message(", .kMMMMWNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMk. ,")
message(", 'OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO' ,")
message(", .dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNd. ,")
message(", 'dXMMMMMMMMMMMMMMMMMMMMMMMMMMXd' ,")
message(", .;oOXWMMMMMMMMMMMMMMWXOo;. ,")
message(", .';:cllllc:;'. ,")
message("o,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,o")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(SOURCES
myresource.qrc
src/colorbutton.cpp
src/commands.cpp
src/document.cpp
src/element.cpp
src/image.cpp
src/keypresseater.cpp
src/main.cpp
src/mainwindow.cpp
src/mrdoc.cpp
src/page.cpp
src/pagesettingsdialog.cpp
src/qcompressor.cpp
src/quickmenu.cpp
src/quickmenu.ui
src/selection.cpp
src/settingsdialog.cpp
src/settingsdialog.ui
src/stroke.cpp
src/tabletapplication.cpp
src/text.cpp
src/tools.cpp
src/widget.cpp
)
set(HEADERS
src/colorbutton.h
src/commands.h
src/document.h
src/element.h
src/image.h
src/keypresseater.h
src/mainwindow.h
src/mrdoc.h
src/page.h
src/pagesettingsdialog.h
src/qcompressor.h
src/quickmenu.h
src/selection.h
src/settingsdialog.h
src/stroke.h
src/tabletapplication.h
src/text.h
src/tictoc.h
src/tools.h
src/version.h
src/widget.h
)
if (APPLE)
set(osx_icon "${CMAKE_SOURCE_DIR}/MrWriter.icns")
set_source_files_properties(${osx_icon} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
add_executable(MrWriter MACOSX_BUNDLE ${osx_icon} ${SOURCES} ${HEADERS})
set_target_properties(MrWriter PROPERTIES
BUNDLE True
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/Info.plist
)
else()
add_executable(MrWriter ${SOURCES} ${HEADERS})
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_property(TARGET MrWriter PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_options(MrWriter PRIVATE -fPIC)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(ZLIB REQUIRED)
if (WIN32)
set_target_properties(MrWriter PROPERTIES WIN32_EXECUTABLE true)
endif()
message("build type: ${CMAKE_BUILD_TYPE}")
if (CMAKE_BUILD_TYPE MATCHES Release)
message("Release build")
target_compile_definitions(MrWriter PRIVATE QT_NO_DEBUG_OUTPUT)
endif()
if (${USE_CONAN})
set(LIBS ${CONAN_LIBS})
else()
set(LIBS Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Xml Qt5::Test Qt5::PrintSupport Qt5::Concurrent Qt5::Test z)
endif()
message(${LIBS})
target_link_libraries(MrWriter ${LIBS})
install(TARGETS MrWriter DESTINATION ${CMAKE_BINARY_DIR}/appdir/usr/bin)