-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
140 lines (108 loc) · 4.7 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
SET(CUDA_TOOLKIT_ROOT "/usr/local/cuda")
FIND_PACKAGE(OpenThreads)
FIND_PACKAGE(osg)
FIND_PACKAGE(osgUtil)
FIND_PACKAGE(osgDB)
FIND_PACKAGE(osgText)
FIND_PACKAGE(osgParticle)
FIND_PACKAGE(osgTerrain)
FIND_PACKAGE(osgViewer)
FIND_PACKAGE(osgGA)
FIND_PACKAGE(osgWidget)
FIND_PACKAGE(osgAnimation)
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(GLUT)
FIND_PACKAGE(OpenEXR)
FIND_PACKAGE(OsgCompute)
SET(POCO_FIND_REQUIRED 1)
FIND_PACKAGE(Poco)
SET(JANSSON_FIND_REQUIRED 1)
FIND_PACKAGE(jansson)
## load in pkg-config support
FIND_PACKAGE(PkgConfig)
## use pkg-config to get hints for 0mq locations
pkg_check_modules(PC_ZeroMQ QUIET zmq)
## use the hint from above to find where 'zmq.hpp' is located
FIND_PATH(ZeroMQ_INCLUDE_DIR
NAMES zmq.hpp
PATHS ${PC_ZeroMQ_INCLUDE_DIRS}
)
## use the hint from about to find the location of libzmq
FIND_LIBRARY(ZeroMQ_LIBRARY
NAMES zmq
PATHS ${PC_ZeroMQ_LIBRARY_DIRS}
)
SET(OSG_LIBS ${OPENTHREADS_LIBRARIES} ${OSG_LIBRARIES} ${OSGVIEWER_LIBRARIES} ${OSGGA_LIBRARIES} ${OSGDB_LIBRARIES} ${OSGWIDGET_LIBRARIES} ${OSGUTIL_LIBRARIES} ${OSGTEXT_LIBRARIES} ${OSGANIMATION_LIBRARIES})
SET(EXR_LIBS ${OPENEXR_LIBRARIES})
SET(DS_SOURCES
src/dsosg.cpp
src/WindowCaptureCallback.cpp
src/StimulusInterface.cpp
src/InvalidBoundsCallback.cpp
src/load_cubemap.cpp
src/ResourceLoader.cpp
src/ProjectCubemapToGeometryPass.cpp
src/DisplaySurfaceGeometry.cpp
src/base64.cpp
src/json2osg.cpp
src/util.cpp
src/exrutil.cpp
src/camera_model.cpp
src/TexturedGeometryToCameraImagePass.cpp
src/CameraImageToDisplayImagePass.cpp
src/GeometryTextureToDisplayImagePass.cpp)
IF(OSG_COMPUTE_FOUND)
MESSAGE("Building With CUDA support")
add_definitions( -DFLYVR_USE_CUDA )
ELSE(OSG_COMPUTE_FOUND)
MESSAGE("Building Without CUDA support")
ENDIF(OSG_COMPUTE_FOUND)
ADD_LIBRARY(DisplaySurfaceArbitraryGeometry SHARED src/DisplaySurfaceArbitraryGeometry.cpp)
TARGET_LINK_LIBRARIES(DisplaySurfaceArbitraryGeometry ${OSG_LIBS})
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
FILE(COPY data DESTINATION ${PROJECT_BINARY_DIR})
FILE(COPY src/shaders DESTINATION ${PROJECT_BINARY_DIR}/src/)
FILE(COPY config DESTINATION ${PROJECT_BINARY_DIR} )
# the flyvr library (for building stimulus plugins) --------------------
ADD_LIBRARY(flyvr SHARED src/ResourceLoader.cpp src/StimulusInterface.cpp src/InvalidBoundsCallback.cpp src/load_cubemap.cpp)
TARGET_LINK_LIBRARIES(flyvr ${POCO_LIBRARIES})
# default stimulus plugins --------------------
ADD_LIBRARY(Stimulus3DDemo SHARED src/Stimulus3DDemo.cpp src/util.cpp)
TARGET_LINK_LIBRARIES(Stimulus3DDemo ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
ADD_LIBRARY(Stimulus3DShaderDemo SHARED src/Stimulus3DShaderDemo.cpp src/util.cpp)
TARGET_LINK_LIBRARIES(Stimulus3DShaderDemo ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
ADD_LIBRARY(Stimulus2DBlit SHARED src/Stimulus2DBlit.cpp src/json2osg.cpp src/base64.cpp)
TARGET_LINK_LIBRARIES(Stimulus2DBlit ${OSG_LIBS} ${POCO_LIBRARIES} ${JANSSON_LIBRARIES} flyvr)
ADD_LIBRARY(StimulusStandby SHARED src/StimulusStandby.cpp)
TARGET_LINK_LIBRARIES(StimulusStandby ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
ADD_LIBRARY(StimulusOSG SHARED src/StimulusOSG.cpp)
TARGET_LINK_LIBRARIES(StimulusOSG ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
ADD_LIBRARY(StimulusOSG2 SHARED src/StimulusOSG2.cpp)
TARGET_LINK_LIBRARIES(StimulusOSG2 ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
# seems to segfault on OSG 3-2 randomly in osg::Text
ADD_LIBRARY(StimulusLatencyTimestamp SHARED src/StimulusLatencyTimestamp.cpp)
TARGET_LINK_LIBRARIES(StimulusLatencyTimestamp ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
ADD_LIBRARY(StimulusAxes SHARED src/StimulusAxes.cpp)
TARGET_LINK_LIBRARIES(StimulusAxes ${OSG_LIBS} ${POCO_LIBRARIES} flyvr)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include")
INCLUDE_DIRECTORIES(
${OSG_COMPUTE_INCLUDE_PATHS} ${OPENEXR_INCLUDE_PATHS}
)
# build the main display server node ----------
ADD_EXECUTABLE(display_server src/main.cpp ${DS_SOURCES})
TARGET_INCLUDE_DIRECTORIES(display_server PUBLIC ${ZeroMQ_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(display_server ${OSG_LIBS}
${OPENGL_LIBRARIES} ${GLUT_LIBRARY}
${OPENEXR_LIBRARIES} ${POCO_LIBRARIES} ${POCO_NET_LIBRARY} ${JANSSON_LIBRARIES}
${ZeroMQ_LIBRARY}
${OSG_COMPUTE_LIBRARIES} DisplaySurfaceArbitraryGeometry)
# build osgparsing tool
ADD_EXECUTABLE(parseosg src/parseosg.cpp)
TARGET_LINK_LIBRARIES(parseosg ${OSG_LIBS})
# build non-ROS programs ----------
ADD_LIBRARY(noaffinity SHARED src/noaffinity.c)