From 27dedd5c11194b4de4e6c205fdba8454d5be8823 Mon Sep 17 00:00:00 2001 From: Adel KARA SLIMANE Date: Mon, 30 Dec 2024 23:47:44 +0100 Subject: [PATCH] Sync with upstream plugin template When installing on linux, currently the project has things hard-coded in cmake to install to - usr/dist/obs-multi-rtmp/data/locale for the translation files - usr/dist/obs-multi-rtmp/bin/64bit/obs-multi-rtmp.so for the shared library Yet we want things to go to these two folders instead - usr/share/obs/obs-plugins/obs-multi-rtmp/locale/ - usr/lib64/obs-plugins/obs-multi-rtmp.so Use upstream template code [1] that enables using these vars to decide where things get installed - CMAKE_INSTALL_BINDIR - CMAKE_INSTALL_LIBDIR - CMAKE_INSTALL_DATAROOTDIR [1] https://github.com/obsproject/obs-plugintemplate --- cmake/common/buildspec_common.cmake | 4 ++-- cmake/linux/helpers.cmake | 30 ++++------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake index b991e9d..b2c2414 100644 --- a/cmake/common/buildspec_common.cmake +++ b/cmake/common/buildspec_common.cmake @@ -90 +90 @@ function(_setup_obs_studio) - COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api --config RelWithDebInfo --parallel + COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api --config Debug --parallel @@ -103 +103 @@ function(_setup_obs_studio) - COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development --config RelWithDebInfo --prefix + COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development --config Debug --prefix diff --git a/cmake/linux/helpers.cmake b/cmake/linux/helpers.cmake index 92974fd..e662f96 100644 --- a/cmake/linux/helpers.cmake +++ b/cmake/linux/helpers.cmake @@ -7,2 +6,0 @@ include(helpers_common) -set(PLUGIN_FOLDER ${CMAKE_PROJECT_NAME}) - @@ -29,13 +26,0 @@ function(set_target_properties_plugin target) - # install( - # TARGETS ${target} - # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - # LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins) - - if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) - set(OBSARCHNAME "32bit") - elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8) - set(OBSARCHNAME "64bit") - else () - message(FATAL_ERROR "Unsupport architecture") - endif() - @@ -44,2 +29,2 @@ function(set_target_properties_plugin target) - RUNTIME DESTINATION dist/${PLUGIN_FOLDER}/bin/${OBSARCHNAME} - LIBRARY DESTINATION dist/${PLUGIN_FOLDER}/bin/${OBSARCHNAME}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins) @@ -82 +67 @@ function(target_install_resources target) - DESTINATION dist/${PLUGIN_FOLDER}/data + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target} @@ -91,3 +76 @@ function(target_add_resource target resource) - # install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}) - - install(FILES "${resource}" DESTINATION dist/${PLUGIN_FOLDER}/data) + install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})