-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
150 lines (126 loc) · 5.42 KB
/
Copy pathCMakeLists.txt
File metadata and controls
150 lines (126 loc) · 5.42 KB
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
# Root cmake file.
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(visGUI)
include(vgVersion.cmake)
# Include essential cmake modules.
include(CMakeDependentOption)
# User-configurable build options for...
# ...Applications
option(VISGUI_ENABLE_VIQUI "Build viqui application" ON)
option(VISGUI_ENABLE_VPVIEW "Build vpView application" ON)
option(VISGUI_ENABLE_VSPLAY "Build vsPlay application" ON)
# ...External library features
option(VISGUI_ENABLE_GDAL "Enable features that require GDAL" OFF)
option(VISGUI_ENABLE_KWPPT "Enable features that require KWPPT" OFF)
option(VISGUI_ENABLE_VIDTK "Enable features that require VidTK" ON)
option(VISGUI_ENABLE_KWIVER "Enable features that require KWIVER" ON)
option(VISGUI_ENABLE_SUPER3D "Enable features that require Super3D" OFF)
# ...Python bindings
option(VISGUI_ENABLE_PYTHON "Enable VisGUI Python bindings" OFF)
# ...Install options
option(VISGUI_DISABLE_FIXUP_BUNDLE "Disable install fixup bundle utility" OFF)
# ...General features
option(BUILD_TESTING "Build tests" OFF)
option(BUILD_SDK_DOCUMENTATION "Build SDK documentation" OFF)
option(BUILD_USER_DOCUMENTATION "Build user documentation" OFF)
# Include core CMake support code.
include(CMake/functions.cmake)
include(CMake/wrapping.cmake)
include(CMake/doxygen.cmake)
# Find dependencies. These manage to be more complicated than simple calls to
# find_package with remarkable consistency, so are in a separate file.
set(global_library_search_paths)
include(CMake/coredeps.cmake)
# We currently build static libraries by default. This might change in the
# future.
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
set(VISGUI_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
if(NOT BUILD_SHARED_LIBS)
message(WARNING
"Building static libraries has known problems related to Qt meta-objects. "
"Any application using plugins will likely crash. "
"This configuration is NOT recommended.")
endif()
# Set build tool configuration options
include(CMake/config.cmake NO_POLICY_SCOPE)
# Place executable and libraries in a common location, rather than their
# respective build directories.
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(VTK_MODULES_DIR "${visGUI_BINARY_DIR}/${VTK_INSTALL_PACKAGE_DIR}/Modules")
set(VTK_INSTALL_PYTHON_USING_CMAKE TRUE)
# Include testing support.
include(CMake/testing.cmake)
# Create ABI exports header
include(CMake/exports.cmake)
vg_generate_export_header(
"${PROJECT_BINARY_DIR}/vgExport.h"
"${PROJECT_SOURCE_DIR}/vgExport.cmake"
)
add_library(${PROJECT_NAME} INTERFACE)
install_headers("${PROJECT_BINARY_DIR}/vgExport.h" TARGET ${PROJECT_NAME})
# Create package config for build directory
set(VisGUI_INCLUDE_DIR "${visGUI_BINARY_DIR}/include")
configure_file(
CMake/VisGUIConfig.cmake.in "${visGUI_BINARY_DIR}/VisGUIConfig.cmake"
@ONLY
)
# Create package config for install directory
set(VisGUI_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
configure_file(
CMake/VisGUIConfig.cmake.in "${visGUI_BINARY_DIR}/VisGUIConfig-install.cmake"
@ONLY
)
# Configure developer environment
configure_file(
setupDevel.sh.in "${visGUI_BINARY_DIR}/setupDevel.sh" @ONLY
)
install(FILES "${visGUI_BINARY_DIR}/VisGUIConfig-install.cmake"
COMPONENT Development
DESTINATION lib/cmake RENAME VisGUIConfig.cmake
)
install(EXPORT VisGUI
COMPONENT Development
DESTINATION lib/cmake FILE VisGUIConfigTargets.cmake
)
# Allow subprojects to find configured headers
include_directories(${PROJECT_BINARY_DIR})
if(VISGUI_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED VERSION 2.7)
find_package(PythonLibs REQUIRED)
find_package(Shiboken REQUIRED)
find_package(PySide REQUIRED)
set(PYTHON_SHORT python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
# Create 'virtual modules' for use as wrapping dependencies, starting with
# common properties (note that any PySide dependency requires using the
# pyside_global.h header, which in turn brings in all of Qt that is wrapped
# by PySide, hence every 'virtual module' needs include paths for everything)
foreach(_module Core Gui)
set(PySide:${_module}_TYPESYSTEM_PATHS ${PYSIDE_TYPESYSTEMS})
set(PySide:${_module}_WRAP_INCLUDE_DIRS
${PYSIDE_INCLUDE_DIR}
${PYSIDE_INCLUDE_DIR}/QtCore
${PYSIDE_INCLUDE_DIR}/QtGui
)
set(PySide:${_module}_WRAP_LINK_LIBRARIES ${PYSIDE_LIBRARY})
set(PySide:${_module}_GLOBAL_HEADER pyside_global.h)
endforeach()
# Set typesystem for each 'virtual module'
set(PySide:Core_TYPESYSTEM "typesystem_core.xml")
set(PySide:Gui_TYPESYSTEM "typesystem_gui.xml")
endif()
# Include subdirectories to build.
add_subdirectory(Libraries)
add_subdirectory(Modules)
add_subdirectory(Web)
add_subdirectory(Applications)
add_subdirectory(Plugins)
add_subdirectory(Tools)
add_subdirectory(Documentation)
# Install rules need to be in a separate directory
add_subdirectory(CMake/InstallRules)
# Create exports file
get_property(VisGUI_EXPORT_TARGETS GLOBAL PROPERTY VisGUI_EXPORT_TARGETS)
set(VisGUI_EXPORT_FILE "${visGUI_BINARY_DIR}/VisGUIConfigTargets.cmake")
export(TARGETS ${VisGUI_EXPORT_TARGETS} FILE "${VisGUI_EXPORT_FILE}")