-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
60 lines (46 loc) · 1.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
cmake_minimum_required(VERSION 2.8.9)
project(MVCDemo)
# Find includes in corresponding build directories.
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# Find the Qt libraries
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
# Dependencies
find_package(OpenGL REQUIRED)
find_package(CGAL REQUIRED)
# CGAL: Wrong rounding: -frounding-math option with GCC
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions(-frounding-math)
endif()
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SOURCES ${SRC_DIR}/glwidget.cpp
${SRC_DIR}/main.cpp
${SRC_DIR}/mainwindow.cpp
${SRC_DIR}/MVCCloner.cpp
${SRC_DIR}/sourcewidget.cpp
${SRC_DIR}/utils.cpp
)
set(HEADERS ${SRC_DIR}/CloningParameters.h
${SRC_DIR}/CoordinatesMesh.h
${SRC_DIR}/glwidget.h
${SRC_DIR}/mainwindow.h
${SRC_DIR}/mvcshaders.h
${SRC_DIR}/MVCCloner.h
${SRC_DIR}/sourcewidget.h
${SRC_DIR}/utils.h
)
# Includes
include_directories(${GLU_INCLUDE_PATH} ${CGAL_INCLUDE_DIRS})
# Add Qt resources
qt5_add_resources(RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/images/images.qrc
${CMAKE_CURRENT_SOURCE_DIR}/src/shaders.qrc
)
# Create an executable.
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${RESOURCES})
# Use Qt modules.
qt5_use_modules(${PROJECT_NAME} Core Gui OpenGL)
# Link libraries
target_link_libraries(${PROJECT_NAME} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} ${CGAL_LIBRARY} gmp)