From e9148a9bbdea32f989d3c8ccaccedab77acc6985 Mon Sep 17 00:00:00 2001 From: nissebergman Date: Tue, 21 Jun 2022 18:23:02 +0200 Subject: [PATCH] Rebasing modified CMake-files to fetch and link GStreamer --- .gitmodules | 4 +++- CMakeLists.txt | 2 ++ apps/CMakeLists.txt | 3 --- apps/OpenSpace/CMakeLists.txt | 12 ++++++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 8bffd188f8..aaaa1d579c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,9 @@ branch = OpenSpace [submodule "apps/OpenSpace/ext/sgct"] path = apps/OpenSpace/ext/sgct - url = https://github.com/sgct/sgct + # url = https://github.com/sgct/sgct + url = https://github.com/nissebergman/sgct.git + branch = gstreamer-functionality [submodule "modules/fitsfilereader/ext/CCfits"] path = modules/fitsfilereader/ext/CCfits url = https://github.com/OpenSpace/CCfits.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e5b4a10d4b..22752b532c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ if (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(FATAL_ERROR "OpenSpace can only be generated for 64 bit architectures.") endif () + ########################################################################################## # Cleanup project # ########################################################################################## @@ -242,6 +243,7 @@ endif () # Misc settings # ########################################################################################## + # Manage the CPack packaging include(${PROJECT_SOURCE_DIR}/support/cmake/packaging.cmake) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index d28a99f874..3e59ce4996 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -40,9 +40,6 @@ file(GLOB app_dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_D list(REMOVE_ITEM app_dirs ".DS_Store") list(REMOVE_ITEM app_dirs "CMakeLists.txt") - - - message(STATUS "Enabled applications:") foreach (app ${app_dirs}) string(TOUPPER ${app} upper_app) diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index f79ee8f174..053cb99800 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -195,3 +195,15 @@ if (WIN32) COMMAND_EXPAND_LISTS ) endif () + +# Handles dll copying and library linking for GStreamer functionality. +if(SGCT_GSTREAMER_SUPPORT) + include(${OPENSPACE_BASE_DIR}/apps/OpenSpace/ext/sgct/ext/gstreamer/copy_gstreamer_libs.cmake) + copy_gstreamer_dlls(OpenSpace) + link_gstreamer_libs(OpenSpace) + + target_compile_definitions(OpenSpace PUBLIC + $<$:SGCT_HAS_GSTREAMER> + "OPENSPACE_ROOT=\"${PROJECT_SOURCE_DIR}\"" # Path variable to be picked up in the GStreamer C++ + ) +endif()