-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
164 lines (113 loc) · 5.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
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
cmake_minimum_required(VERSION 2.8)
project(BarycentricMapping)
IF(WIN32)
SET(CMAKE_PREFIX_PATH "$ENV{QT_PATH}")
ENDIF()
OPTION(TOUCH_SCREEN_MODE "If touchscreen mode or not" OFF)
###########################
# Sources
file(GLOB_RECURSE BARY_MAPPING_SOURCES "src/geom/*.cpp")
file(GLOB_RECURSE BARY_MAPPING_SOURCES_TMP "src/qt/*.cpp")
LIST(APPEND BARY_MAPPING_SOURCES ${BARY_MAPPING_SOURCES_TMP})
file(GLOB_RECURSE BARY_MAPPING_HEADERS "src/geom/*.hpp")
file(GLOB_RECURSE BARY_MAPPING_HEADERS_TMP "src/qt/*.hpp")
LIST(APPEND BARY_MAPPING_HEADERS ${BARY_MAPPING_HEADERS_TMP})
file(GLOB_RECURSE BARY_MAPPING_RESOURCES "src/resource/main.qrc")
IF(TOUCH_SCREEN_MODE)
file(GLOB_RECURSE BARY_MAPPING_SOURCES_TMP "src/qtTouch/*.cpp")
LIST(APPEND BARY_MAPPING_SOURCES ${BARY_MAPPING_SOURCES_TMP})
file(GLOB_RECURSE BARY_MAPPING_HEADERS_TMP "src/qtTouch/*.hpp")
LIST(APPEND BARY_MAPPING_HEADERS ${BARY_MAPPING_HEADERS_TMP})
file(GLOB_RECURSE BARY_MAPPING_SOURCES_TMP "src/mail/*.cpp")
LIST(APPEND BARY_MAPPING_SOURCES ${BARY_MAPPING_SOURCES_TMP})
# file(GLOB_RECURSE BARY_MAPPING_HEADERS_TMP "src/mail/*.h")
# LIST(APPEND BARY_MAPPING_HEADERS ${BARY_MAPPING_HEADERS_TMP})
LIST(APPEND BARY_MAPPING_RESOURCES "src/resource/icons.qrc" "src/resource/sounds.qrc" "src/resource/opencv.qrc")
file(GLOB_RECURSE BARY_MAPPING_QT_SRC_HEADERS "src/qtTouch/*.hpp" "src/qt/*.hpp" "src/mail/*.h")
file(GLOB_RECURSE BARY_MAPPING_UIS "src/qtTouch/*.ui" "src/qt/*.ui")
SET(BARY_MAPPING_INCLUDE "src" "src/qt" "src/geom" "src/qtTouch" "src/mail")
ELSE()
file(GLOB_RECURSE BARY_MAPPING_QT_SRC_HEADERS "src/qt/*.hpp")
file(GLOB_RECURSE BARY_MAPPING_UIS "src/qt/*.ui")
SET(BARY_MAPPING_INCLUDE "src" "src/qt" "src/geom")
ENDIF()
SET(BARY_MAPPING_MAIN "src/main.cpp")
#########################
#########################
# Libs
FIND_PACKAGE(Qt5 COMPONENTS Core Gui Xml OpenGL Widgets REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Core_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Core_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Core_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5Gui_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Gui_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Gui_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5Xml_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Xml_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Xml_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5OpenGL_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5OpenGL_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5OpenGL_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Widgets_LIBRARIES})
IF(TOUCH_SCREEN_MODE)
FIND_PACKAGE(Qt5 COMPONENTS Multimedia MultimediaWidgets PrintSupport REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Multimedia_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Multimedia_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Multimedia_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5MultimediaWidgets_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5MultimediaWidgets_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5MultimediaWidgets_LIBRARIES})
INCLUDE_DIRECTORIES(${Qt5PrintSupport_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5PrintSupport_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5PrintSupport_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTOUCH_SCREEN_MODE")
ENDIF()
IF(WIN32)
FIND_PACKAGE(Qt5 COMPONENTS Winextras REQUIRED)
INCLUDE_DIRECTORIES(${Qt5Winextras_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Winextras_DEFINITIONS})
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${Qt5Winextras_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX -MT /MT")
ELSE()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_KINECT")
ENDIF()
FIND_PACKAGE(OpenGL REQUIRED)
IF(OPENGL_FOUND)
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES} ${OPENGL_LIBRARIES})
INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
ELSE()
message(FATAL_ERROR "OpenGl not found!")
ENDIF()
IF(TOUCH_SCREEN_MODE)
SET(OpenCV_DIR "C:/opencv/build")
FIND_PACKAGE(OpenCV)
IF(OpenCV_FOUND)
INCLUDE_DIRECTORIES("${OpenCV_DIR}/include")
INCLUDE_DIRECTORIES(OpenCV_INCLUDE_DIR)
SET(BARY_MAPPING_LINK_LIBRARIES ${BARY_MAPPING_LINK_LIBRARIES}; ${OpenCV_LIBS})
ELSE()
message(FATAL_ERROR "Unable to find OpenCV")
ENDIF()
ENDIF()
#########################
#########################
# QT
set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTOPENGL TRUE)
QT5_WRAP_CPP(BARY_MAPPING_HEADERS_MOC ${BARY_MAPPING_QT_SRC_HEADERS})
QT5_WRAP_UI(BARY_MAPPING_FORMS_HEADERS ${BARY_MAPPING_UIS})
QT5_ADD_RESOURCES(BARY_MAPPING_RESOURCES_RCC ${BARY_MAPPING_RESOURCES})
#########################
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
IF(APPLE)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0")
ENDIF()
INCLUDE_DIRECTORIES(${BARY_MAPPING_INCLUDE})
SET(BARY_MAPPING_SOURCES ${BARY_MAPPING_MAIN}; ${BARY_MAPPING_SOURCES}; ${VESTIGE_RESOURCES_RCC})
add_executable(BarycentricMapping ${BARY_MAPPING_SOURCES} ${BARY_MAPPING_HEADERS_MOC} ${BARY_MAPPING_FORMS_HEADERS} ${BARY_MAPPING_HEADERS} ${BARY_MAPPING_RESOURCES_RCC})
TARGET_LINK_LIBRARIES(BarycentricMapping ${BARY_MAPPING_LINK_LIBRARIES})