Skip to content

Commit

Permalink
feat: Out of tree build (#105)
Browse files Browse the repository at this point in the history
Allows to build this plugin outside of obs-studio project tree
  • Loading branch information
eaglesemanation authored Dec 22, 2021
1 parent 898f953 commit 986648c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
28 changes: 22 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,32 @@ if(WIN32)
move-transition.rc)
endif()

if(BUILD_OUT_OF_TREE)
find_package(LibObs REQUIRED)
endif()

add_library(move-transition MODULE
${move-transition_HEADERS}
${move-transition_SOURCES})

target_include_directories(move-transition PRIVATE
"${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")

target_link_libraries(move-transition
obs-frontend-api
libobs)

set_target_properties(move-transition PROPERTIES FOLDER "plugins/exeldro")
install_obs_plugin_with_data(move-transition data)
if(BUILD_OUT_OF_TREE)
if(NOT LIB_OUT_DIR)
set(LIB_OUT_DIR "/lib/obs-plugins")
endif()
if(NOT DATA_OUT_DIR)
set(DATA_OUT_DIR "/share/obs/obs-plugins/move-transition")
endif()
set_target_properties(move-transition PROPERTIES PREFIX "")
install(TARGETS move-transition
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(DIRECTORY data/locale
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
else()
target_include_directories(move-transition PRIVATE
"${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
set_target_properties(move-transition PROPERTIES FOLDER "plugins/exeldro")
install_obs_plugin_with_data(move-transition data)
endif()
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ Plugin for OBS Studio to move source to a new position during scene transition
https://obsproject.com/forum/resources/move-transition.913/

# Build
- Build OBS Studio: https://obsproject.com/wiki/Install-Instructions
- Check out this repository to plugins/move-transition
- Add `add_subdirectory(move-transition)` to plugins/CMakeLists.txt
- Rebuild OBS Studio
1. In-tree build
- Build OBS Studio: https://obsproject.com/wiki/Install-Instructions
- Check out this repository to plugins/move-transition
- Add `add_subdirectory(move-transition)` to plugins/CMakeLists.txt
- Rebuild OBS Studio

1. Stand-alone build (Linux only)
- Verify that you have package with development files for OBS
- Check out this repository and run `cmake -S . -B build -DBUILD_OUT_OF_TREE=On && cmake --build build`

# Donations
https://www.paypal.me/exeldro

1 comment on commit 986648c

@eribertomota
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these changes. This commit make the Debian packaging easier.

Please sign in to comment.