-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
184 lines (146 loc) · 5.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
# Minimum CMake version required
cmake_minimum_required(VERSION 3.4)
# Global name of the project
project(QmlDemo VERSION 0.1.0 LANGUAGES CXX)
# Specify compiler features
set(CMAKE_CXX_STANDARD 14)
message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
# Compiler options
if(MSVC)
message("Compiler: ${CMAKE_CXX_COMPILER_ID}")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("Compiler: ${CMAKE_CXX_COMPILER_ID}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message("Compiler: ${CMAKE_CXX_COMPILER_ID}")
# Default compile flags (read: turn on all checks)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-documentation -pedantic -Werror")
# Extra compile flags to turn of stuff we don't want to handle at the moment
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-exit-time-destructors")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-qualifiers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-virtual-dtor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-id-macro")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code-return")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-macros")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-reinterpret-cast")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-statement-expression")
else()
message(WARNING "Compiler <${CMAKE_CXX_COMPILER_ID}> is not a supported C++ compiler.")
endif()
# Adjust the CMAKE_MODULE_PATH to include the "local" cmake/Modules directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
################################
# Find the required Qt libraries
find_package(Qt5Core 5.1)
find_package(Qt5Quick 5.1)
find_package(Qt5Gui 5.1)
################################
# Find GMlib
find_package(
GMlib 0.6.9 EXACT
PATHS ${GMLIB_DIR}
NO_DEFAULT_PATH
)
message( "GMlib_INCLUDE_DIRS: ${GMlib_INCLUDE_DIRS}" )
message( "GMlib_LINK_DIRS: ${GMlib_LINK_DIRS}" )
message( "GMlib_DEFINITIONS: ${GMlib_DEFINITIONS}" )
message( "GMlib_LIBRARIES: ${GMlib_LIBRARIES}" )
include_directories( ${GMlib_INCLUDE_DIRS} )
link_directories( ${GMlib_LINK_DIRS} )
add_definitions(${GMlib_DEFINITIONS})
include_directories( ${GLEW_INCLUDE_DIRS} )
if(WIN32)
add_definitions(-DGLEW_STATIC)
endif(WIN32)
#######
# Files
set( HDRS
hidmanager/hidaction.h
hidmanager/hidbinding.h
hidmanager/hidinput.h
hidmanager/hidinputevent.h
hidmanager/hidkbmouseinput.h
hidmanager/hidmanager.h
hidmanager/hidmanagertreemodel.h
hidmanager/standardhidmanager.h
hidmanager/defaulthidmanager.h
application/fboinsgrenderer.h
application/gmlibwrapper.h
application/guiapplication.h
application/window.h
application/utils.h
testtorus.h
scenario.h
myfirstcurve.h
myspline.h
mybcurve.h
myblendcurve.h
myclosedcurve.h
mybsurface.h
simplesubsurf.h
)
set( SRCS
hidmanager/hidaction.cpp
hidmanager/hidbinding.cpp
hidmanager/hidinput.cpp
hidmanager/hidinputevent.cpp
hidmanager/hidkbmouseinput.cpp
hidmanager/hidmanager.cpp
hidmanager/hidmanagertreemodel.cpp
hidmanager/standardhidmanager.cpp
hidmanager/defaulthidmanager.cpp
application/fboinsgrenderer.cpp
application/gmlibwrapper.cpp
application/guiapplication.cpp
application/window.cpp
application/main.cpp
scenario.cpp
)
#########
# Moc'ing
QT5_WRAP_CPP( HDRS_MOC
hidmanager/hidaction.h
hidmanager/hidmanager.h
hidmanager/hidmanagertreemodel.h
hidmanager/standardhidmanager.h
hidmanager/defaulthidmanager.h
application/fboinsgrenderer.h
application/gmlibwrapper.h
application/guiapplication.h
application/window.h
scenario.h
)
set( RCCS
application/application.qrc
)
QT5_ADD_RESOURCES( RCCS_MOC ${RCCS} )
#########
# Compile
add_executable( ${CMAKE_PROJECT_NAME} ${HDRS} ${SRCS} ${HDRS_MOC} ${FORM_HDRS} ${RCCS_MOC} )
######
# Link
target_link_libraries( ${CMAKE_PROJECT_NAME}
${GMlib_LIBRARIES}
Qt5::Core
Qt5::Quick
Qt5::Gui
${GLEW_LIBRARIES}
${OPENGL_LIBRARIES}
)