-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
109 lines (94 loc) · 3.14 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
cmake_minimum_required(VERSION 3.10)
project(heap_history_viewer CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
include(${CMAKE_SOURCE_DIR}/conan.cmake)
if (DEFINED ENV{CMAKE_PREFIX_PATH})
message(STATUS "Getting Qt from the system. CMAKE_PREFIX_PATH = $ENV{CMAKE_PREFIX_PATH}")
set(NEEDED_CONAN_DEPENDENCIES gflags/2.2.2@bincrafters/stable)
else ()
message(STATUS "To use the Qt from your system, set the CMAKE_PREFIX_PATH env var")
message(STATUS "Trying to get Qt from Conan")
message(STATUS "If it fails try: 'conan remote add bincrafters \"https://api.bintray.com/conan/bincrafters/public-conan\"'")
set(NEEDED_CONAN_DEPENDENCIES gflags/2.2.2@bincrafters/stable qt/5.12.6@bincrafters/stable)
endif ()
conan_cmake_run(REQUIRES ${NEEDED_CONAN_DEPENDENCIES} BASIC_SETUP BUILD missing)
set(CMAKE_CPP_STANDARD 17)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt5Test REQUIRED)
if(APPLE)
# Silence OpenGL deprication warnings
add_definitions(-DGL_SILENCE_DEPRECATION)
endif()
# Not sure which OpenGL_GL_PREFERENCE is the best - the alternative is LEGACY
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
# Warnings:
# TODO(patricia-gallardo): Fix all of these
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(EXTRA_WARNINGS /WX) # -Werror
# /wd4244 disables warings around conversion to or from 'long double', possible loss of data
set(TEMPORARILY_DISABLED_WARNINGS /wd4244)
else ()
set(EXTRA_WARNINGS -Werror -Wall -Wextra)
set(TEMPORARILY_DISABLED_WARNINGS)
endif ()
add_executable(HeapVizGL
heapvizwindow.ui
resource.qrc
activeregioncache.cpp
activeregionsdiagramlayer.cpp
addressdiagramlayer.cpp
displayheapwindow.cpp
eventdiagramlayer.cpp
glheapdiagram.cpp
glheapdiagramlayer.cpp
glsl_simulation_functions.cpp
gridlayer.cpp
heapblock.cpp
heapblockdiagramlayer.cpp
heaphistory.cpp
heapvizwindow.cpp
heapwindow.cpp
linearbrightnesscolorscale.cpp
main.cpp
transform3d.cpp
vertex.cpp)
target_link_libraries(HeapVizGL
${CONAN_LIBS}
OpenGL::GL
Qt5::Widgets)
target_compile_options(HeapVizGL PRIVATE
${EXTRA_WARNINGS}
${TEMPORARILY_DISABLED_WARNINGS})
add_executable(HeapVizGLTest
heapvizwindow.ui
resource.qrc
activeregioncache.cpp
activeregionsdiagramlayer.cpp
addressdiagramlayer.cpp
displayheapwindow.cpp
eventdiagramlayer.cpp
glheapdiagram.cpp
glheapdiagramlayer.cpp
glsl_simulation_functions.cpp
gridlayer.cpp
heapblock.cpp
heapblockdiagramlayer.cpp
heaphistory.cpp
heapvizwindow.cpp
heapwindow.cpp
linearbrightnesscolorscale.cpp
testactiveregioncache.cpp
testdisplayheapwindow.cpp
transform3d.cpp
vertex.cpp)
target_link_libraries(HeapVizGLTest
OpenGL::GL
Qt5::Test
Qt5::Widgets)
target_compile_options(HeapVizGLTest PRIVATE
${EXTRA_WARNINGS}
${TEMPORARILY_DISABLED_WARNINGS})