/
CMakeLists.txt
104 lines (88 loc) · 2.28 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
cmake_minimum_required(VERSION 2.8)
project(OpenView)
include(GenerateExportHeader)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
if(APPLE)
find_path(COCOA_INCLUDE_DIR Cocoa.h)
include_directories(${COCOA_INCLUDE_DIR})
endif()
include_directories(
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Quick_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/core
${CMAKE_CURRENT_BINARY_DIR}/core )
add_definitions(
${Qt5Widgets_DEFINITIONS}
${Qt5Quick_DEFINITIONS} )
if(APPLE)
set(install_name_changes "")
set(libs_and_execs "")
endif()
add_subdirectory(core)
qt5_wrap_cpp( OPENVIEW_MOC_FILES
ovGraphView.h
ovScatterPlotView.h
ovScatterPlot3DView.h
ovTreemapView.h
ovTreeringView.h
ovTreeView.h
ovViewPlugin.h
ovViewQuickItem.h
ovView.h )
qt5_add_resources( OPENVIEW_RESOURCES
resources.qrc )
set( OPENVIEW_SRCS
ovAlgorithmItem.cxx
ovContextInteractorStyle.cxx
ovGraphItem.cxx
ovGraphView.cxx
ovScatterPlotView.cxx
ovScatterPlot3DView.cxx
ovTreemapItem.cxx
ovTreemapView.cxx
ovTreeringItem.cxx
ovTreeringView.cxx
ovTreeView.cxx
ovViewQuickItem.cxx
ovView.cxx
${OPENVIEW_MOC_FILES}
${OPENVIEW_RESOURCES} )
set( OPENVIEW_LIBS
ovCore
vtkChartsCore
vtkInteractionStyle
vtkIOInfovis
vtkRenderingCore
vtkRenderingFreeTypeOpenGL
vtkRenderingVolumeOpenGL
vtkViewsContext2D
vtkViewsInfovis
${Qt5Widgets_LIBRARIES}
${Qt5Quick_LIBRARIES} )
if(WIN32)
set(OPENVIEW_LIBS ${OPENVIEW_LIBS} Qt5::WinMain)
endif()
if(APPLE)
add_executable(OpenView ${OPENVIEW_SRCS} main.mm)
elseif(WIN32)
add_executable(OpenView WIN32 ${OPENVIEW_SRCS} main.cxx openview.rc)
else()
add_executable(OpenView ${OPENVIEW_SRCS} main.cxx)
endif()
target_link_libraries(OpenView ${OPENVIEW_LIBS})
set_target_properties(OpenView PROPERTIES
COMPILE_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(APPLE)
install(TARGETS OpenView RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/OpenView.app/Contents/MacOS/")
set(executable_path "${CMAKE_INSTALL_PREFIX}/OpenView.app/Contents/MacOS/OpenView")
list(APPEND libs_and_execs ${executable_path})
else()
install(TARGETS OpenView RUNTIME DESTINATION "bin")
endif()
# Install only currently works on Mac or Windows
if(APPLE OR WIN32)
add_subdirectory(install)
endif()