forked from gazebosim/gz-rendering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
162 lines (130 loc) · 5.02 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
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
151
152
153
154
155
156
157
158
159
160
161
162
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-rendering5 VERSION 5.0.0)
#============================================================================
# Find ignition-cmake
#============================================================================
# If you get an error at this line, you need to install ignition-cmake
find_package(ignition-cmake2 2.3 REQUIRED)
set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR})
#============================================================================
# Set up the project
#============================================================================
ign_configure_project(VERSION_SUFFIX)
#============================================================================
# Set project-specific options
#============================================================================
# ignition-rendering currently has no options that are unique to it
#============================================================================
# Search for project-specific dependencies
#============================================================================
#--------------------------------------
# Find ignition-math
ign_find_package(ignition-math6 REQUIRED VERSION 6.6)
set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})
#--------------------------------------
# Find ignition-common
ign_find_package(ignition-common4 REQUIRED
COMPONENTS graphics events)
set(IGN_COMMON_VER ${ignition-common4_VERSION_MAJOR})
#--------------------------------------
# Find ignition-plugin
ign_find_package(ignition-plugin1 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})
#--------------------------------------
# Find FreeImage
ign_find_package(FreeImage VERSION 3.9
REQUIRED_BY optix
PRIVATE_FOR optix)
#--------------------------------------
# Find OpenGL
ign_find_package(OpenGL
REQUIRED_BY ogre ogre2
PKGCONFIG gl)
if (OpenGL_FOUND)
set(HAVE_OPENGL TRUE)
endif()
#--------------------------------------
# Find OGRE
list(APPEND ign_ogre_components "RTShaderSystem" "Terrain" "Overlay")
ign_find_package(IgnOGRE VERSION 1.8.0
COMPONENTS ${ign_ogre_components}
REQUIRED_BY ogre
PRIVATE_FOR ogre)
if (OGRE_FOUND)
# find boost - mainly needed on macOS and also by the terrain component
find_package(Boost)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
set(HAVE_OGRE TRUE)
endif()
#--------------------------------------
# Find OGRE2
ign_find_package(IgnOGRE2 VERSION 2.1.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)
if (OGRE2_FOUND)
set(HAVE_OGRE2 TRUE)
endif()
# Plugin install dirs
set(IGNITION_RENDERING_ENGINE_INSTALL_DIR
${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/ign-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins
)
#--------------------------------------
# Find dependencies that we ignore for Visual Studio
if(NOT MSVC)
#--------------------------------------
# Find CUDA
find_package(CUDA)
#--------------------------------------
# Find OptiX
ign_find_package(OptiX VERSION 3.8.0
REQUIRED_BY optix
PRIVATE_FOR optix)
if (OptiX_FOUND AND CUDA_FOUND)
set(HAVE_OPTIX TRUE)
endif()
endif()
#####################################
# Define compile-time default variables
if(MSVC)
set(IGN_RENDERING_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})
else()
set(IGN_RENDERING_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
endif()
set(IGN_RENDERING_RESOURCE_PATH ${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR})
#============================================================================
# Configure the build
#============================================================================
if (HAVE_OGRE)
list(APPEND RENDERING_COMPONENTS ogre)
endif()
if (HAVE_OPTIX)
list(APPEND RENDERING_COMPONENTS optix)
endif()
if (HAVE_OGRE2)
list(APPEND RENDERING_COMPONENTS ogre2)
endif()
ign_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS ${RENDERING_COMPONENTS})
#============================================================================
# Create package information
#============================================================================
ign_create_packages()
#============================================================================
# Configure documentation
#============================================================================
configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md)
configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md)
ign_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
TAGFILES
"${IGNITION-COMMON_DOXYGEN_TAGFILE} = ${IGNITION-COMMON_API_URL}"
"${IGNITION-MATH_DOXYGEN_TAGFILE} = ${IGNITION-MATH_API_URL}"
)
file(COPY ${CMAKE_SOURCE_DIR}/tutorials/img/ DESTINATION ${CMAKE_BINARY_DIR}/doxygen/html/img/)