forked from trlsmax/imgui-vtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (53 loc) · 1.64 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
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(imgui-vtk)
set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_VERBOSE_MAKEFILE 1)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(project_name imgui_vtk)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_RELEASE_POSTFIX "")
set(CMAKE_RELWITHDEBINFO_POSTFIX "rd")
set(CMAKE_MINSIZEREL_POSTFIX "s")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
option(BUILD_EXAMPLE "BUILD_EXAMPLE" ON)
find_package(imgui CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(gl3w CONFIG REQUIRED)
find_package(VTK COMPONENTS
CommonCore
CommonColor
CommonDataModel
FiltersCore
InteractionStyle
RenderingCore
RenderingFreeType
RenderingGL2PSOpenGL2
RenderingOpenGL2
QUIET
)
add_library(${project_name} STATIC include/VtkViewer.h src/VtkViewer.cpp)
target_link_libraries(${project_name} PRIVATE imgui::imgui glfw ${VTK_LIBRARIES} unofficial::gl3w::gl3w)
target_include_directories(${project_name}
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/imgui-vtk>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
#if(BUILD_EXAMPLE)
add_subdirectory(example)
#endif()
if (VTK_VERSION VERSION_LESS "9.0.0")
include(${VTK_USE_FILE})
else()
# vtk_module_autoinit is needed
vtk_module_autoinit(
TARGETS ${project_name}
MODULES ${VTK_LIBRARIES}
)
endif()