Skip to content

Commit c91df00

Browse files
committed
cmake: Make CMake build work.
set gnu99 mode. add required config defines. add install targets. match meson lib names. link openhmd. link gio. put gst3d in /lib. remove shared. build gresources. build shared and static libs. fix dll install dir.
1 parent 720cead commit c91df00

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

CMakeLists.txt

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ pkg_check_modules (GST REQUIRED gstreamer-1.0)
88
pkg_check_modules (GST_GL REQUIRED gstreamer-gl-1.0)
99
pkg_check_modules (GST_VIDEO REQUIRED gstreamer-video-1.0)
1010
pkg_check_modules (GLIB REQUIRED glib-2.0)
11+
pkg_check_modules (GIO REQUIRED gio-2.0)
12+
pkg_check_modules (OPENHMD REQUIRED openhmd)
13+
14+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
15+
16+
add_definitions(-DVERSION="0.1.0")
17+
add_definitions(-DPACKAGE="gst-plugins-vr")
18+
add_definitions(-DPACKAGE_NAME="GStreamer Plugins VR")
19+
add_definitions(-DGST_PACKAGE_ORIGIN="c")
1120

1221
include_directories(
1322
${GRAPHENE_INCLUDE_DIRS}
@@ -19,19 +28,40 @@ include_directories(
1928
${CMAKE_SOURCE_DIR}/build
2029
)
2130

31+
set(SHADER_DIR ${CMAKE_SOURCE_DIR}/gpu)
32+
33+
execute_process(
34+
WORKING_DIRECTORY ${SHADER_DIR}
35+
COMMAND glib-compile-resources --target=shaders.c --sourcedir=. --generate-source shaders.gresource.xml)
36+
2237
file(GLOB_RECURSE GST_3D_C ${CMAKE_SOURCE_DIR}/gst-libs/gst/3d/*.c)
2338
file(GLOB_RECURSE GST_3D_H ${CMAKE_SOURCE_DIR}/gst-libs/gst/3d/*.h)
2439

25-
add_library(gst3d ${SOURCES} ${GST_3D_C} ${GST_3D_H})
26-
target_link_libraries(gst3d
40+
add_library(gst3d-1.0 SHARED ${SOURCES} ${GST_3D_C} ${GST_3D_H})
41+
add_library(gst3d-1.0_static STATIC ${SOURCES} ${GST_3D_C} ${GST_3D_H})
42+
43+
target_link_libraries(gst3d-1.0
2744
${GRAPHENE_LIBRARIES}
2845
${GST_LIBRARIES}
2946
${GLIB_LIBRARIES}
3047
${GST_GL_LIBRARIES}
3148
${GST_VIDEO_LIBRARIES}
49+
${GIO_LIBRARIES}
50+
${OPENHMD_LIBRARIES}
3251
)
3352

3453
file(GLOB_RECURSE GST_VR_C ${CMAKE_SOURCE_DIR}/gst/vr/*.c)
3554
file(GLOB_RECURSE GST_VR_H ${CMAKE_SOURCE_DIR}/gst/vr/*.h)
36-
add_library(gstvr ${GST_VR_C} ${GST_VR_H})
37-
target_link_libraries(gstvr gst3d)
55+
add_library(gstvrplugins SHARED ${GST_VR_C} ${GST_VR_H} ${CMAKE_SOURCE_DIR}/gpu/shaders.c)
56+
add_library(gstvrplugins_static STATIC ${GST_VR_C} ${GST_VR_H} ${CMAKE_SOURCE_DIR}/gpu/shaders.c)
57+
target_link_libraries(gstvrplugins gst3d-1.0)
58+
59+
60+
install (TARGETS gstvrplugins gstvrplugins_static
61+
LIBRARY DESTINATION lib/gstreamer-1.0
62+
RUNTIME DESTINATION bin
63+
ARCHIVE DESTINATION lib/gstreamer-1.0)
64+
install (TARGETS gst3d-1.0 gst3d-1.0_static
65+
LIBRARY DESTINATION lib
66+
RUNTIME DESTINATION bin
67+
ARCHIVE DESTINATION lib)

0 commit comments

Comments
 (0)