updated libsoup dependency

This commit is contained in:
benpm
2025-06-06 12:05:39 -06:00
parent 7581fa97b7
commit a357589c23
3 changed files with 69 additions and 6 deletions

30
CMakePresets.json Normal file
View File

@@ -0,0 +1,30 @@
{
"version": 3,
"configurePresets": [
{
"name": "debug-custom-windows",
"displayName": "Debug Custom Configuration (Windows)",
"description": "Debug build with custom options for Windows using MSVC",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"cacheVariables": {
"OPENSPACE_HAVE_TESTS": "OFF",
"OPENSPACE_VIDEO_MODULE": "OFF",
"CMAKE_PREFIX_PATH": "C:/Program Files (x86)/zlib;C:/Program Files/gstreamer/1.0/msvc_x86_64",
"CMAKE_MODULE_PATH": "C:/Program Files/gstreamer/1.0/msvc_x86_64/share/cmake",
"ASSIMP_BUILD_ZLIB": "OFF",
"SGCT_BUILD_TESTS": "OFF",
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
{
"name": "build-debug-custom-windows",
"displayName": "Build Debug Custom Configuration (Windows)",
"description": "Build using the debug-custom-windows configure preset",
"configurePreset": "debug-custom-windows",
"configuration": "Debug"
}
]
}

View File

@@ -178,7 +178,7 @@ set(SGCT_DEP_INCLUDE_SCN OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_CATCH2 OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct)
target_link_libraries(OpenSpace PRIVATE sgct)
target_link_libraries(OpenSpace PUBLIC sgct)
set_target_properties(sgct PROPERTIES FOLDER "External")
set_target_properties(glfw PROPERTIES FOLDER "External")
@@ -201,25 +201,31 @@ end_header("Dependency: SGCT")
# Handles pkg-config for the GStreamer dependencies
if(SGCT_GSTREAMER_SUPPORT)
# For Windows, install pkgconf
find_package(PkgConfig REQUIRED)
find_package(GStreamer REQUIRED)
pkg_search_module(glib REQUIRED IMPORTED_TARGET glib-2.0)
pkg_search_module(gstreamer REQUIRED IMPORTED_TARGET gstreamer-1.0)
pkg_search_module(gstreamer-base REQUIRED IMPORTED_TARGET gstreamer-base-1.0)
pkg_search_module(gstreamer-webrtc REQUIRED IMPORTED_TARGET gstreamer-webrtc-1.0)
pkg_search_module(gstreamer-video REQUIRED IMPORTED_TARGET gstreamer-video-1.0)
pkg_search_module(gstreamer-gl REQUIRED IMPORTED_TARGET gstreamer-gl-1.0)
pkg_search_module(gstreamer-app REQUIRED IMPORTED_TARGET gstreamer-app-1.0)
find_package(libsoup-3.0 REQUIRED)
target_include_directories(OpenSpace PRIVATE ${LIBSOUP_INCLUDE_DIRS})
target_link_libraries(OpenSpace PUBLIC
PkgConfig::glib
PkgConfig::gstreamer
PkgConfig::gstreamer-base
PkgConfig::gstreamer-webrtc
PkgConfig::gstreamer-video
PkgConfig::gstreamer-gl
PkgConfig::gstreamer-app
soup-3.0
)
target_compile_definitions(OpenSpace PUBLIC SGCT_HAS_GSTREAMER)
target_include_directories(OpenSpace PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/ext/gstreamer" "${GStreamer_INCLUDE_DIR}/../libsoup-3.0")
target_compile_definitions(OpenSpace PUBLIC OPENSPACE_ROOT="${CMAKE_SOURCE_DIR}")
message(STATUS "${GStreamer_INCLUDE_DIR}/libsoup-3.0")
target_compile_definitions(OpenSpace PRIVATE SGCT_HAS_GSTREAMER)
# Include gstreamerWebRTC.h
target_include_directories(OpenSpace PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/ext/gstreamer")
target_compile_definitions(OpenSpace PRIVATE OPENSPACE_ROOT="${CMAKE_SOURCE_DIR}")
endif()

View File

@@ -0,0 +1,27 @@
find_package(PkgConfig)
pkg_check_modules(PC_LIBSOUP REQUIRED QUIET libsoup-3.0)
find_path(LIBSOUP_INCLUDE_DIRS
NAMES libsoup/soup.h
HINTS ${PC_LIBSOUP_INCLUDEDIR}
${PC_LIBSOUP_INCLUDE_DIRS}
PATH_SUFFIXES libsoup-3.0
)
find_library(LIBSOUP_LIBRARIES
NAMES soup-3.0
HINTS ${PC_LIBSOUP_LIBDIR}
${PC_LIBSOUP_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libsoup-3.0 REQUIRED_VARS LIBSOUP_INCLUDE_DIRS LIBSOUP_LIBRARIES VERSION_VAR PC_LIBSOUP_VERSION)
# Provide alias for libsoup-3.0
if (DEFINED LIBSOUP_LIBRARIES)
message(STATUS "<*> LIBSOUP_LIBRARIES = ${LIBSOUP_LIBRARIES}")
message(STATUS "<*> LIBSOUP_INCLUDE_DIRS = ${LIBSOUP_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "libsoup-3.0 library not found, but it is required by this project!")
endif()