Skip to content
Snippets Groups Projects
Commit 49cb1e52 authored by Marios.Fanourakis's avatar Marios.Fanourakis
Browse files

updates to cmakelists for windows; updates to README instructions

parent edd51976
No related branches found
No related tags found
No related merge requests found
Pipeline #42694 failed
......@@ -8,7 +8,7 @@ add_library(${CMAKE_PROJECT_NAME} MODULE)
# Replace `Your Name Here` with the name (yours or your organization's) you want
# to see as the author of the plugin (in the plugin's metadata itself and in the
# installers)
set(PLUGIN_AUTHOR "Your Name Here")
set(PLUGIN_AUTHOR "Marios Fanourakis")
# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS
# releases (used both in the installer and when submitting the installer for
......@@ -44,14 +44,30 @@ find_package(Freetype REQUIRED)
ADD_DEFINITIONS(-DOBS_PLUGIN_DIR=\"${OBS_PLUGIN_DIR}\")
include(external/FindLibObs.cmake)
include("external/FindLibObs.cmake")
find_package(LibObs REQUIRED)
#find_package(obs-frontend-api REQUIRED)
#include("external/ObsPluginHelpers.cmake")
#find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets Core)
include_directories(
"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" "${FREETYPE_INCLUDE_DIRS}")
#find_qt(VERSION ${QT_VERSION} COMPONENTS Widgets Core)
if(WIN32)
# TODO: this is not ideal has the first version of the lib found will be used
# We should try to make it so that the correct version of the lib is used when needed (Debug, Release, etc.)
find_library(OBS_FRONTEND_LIBRARY
NAMES "obs-frontend-api"
PATHS "${LibObs_DIR}/../UI/obs-frontend-api/Release"
NO_DEFAULT_PATH)
if(${OBS_FRONTEND_LIBRARY} STREQUAL "OBS_FRONTEND_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Obs frontend library not found, confirm that it is compiled")
else()
message(STATUS "Obs frontend library found at: ${OBS_FRONTEND_LIBRARY} ")
endif()
endif()
#configure_file(src/plugin-macros.h.in
# ${CMAKE_SOURCE_DIR}/src/plugin-macros.generated.h)
......@@ -64,7 +80,7 @@ target_include_directories(${CMAKE_PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(
${CMAKE_PROJECT_NAME} PRIVATE libobs LSL::lsl freetype)# OBS::obs-frontend-api Qt::Core Qt::Widgets)
${CMAKE_PROJECT_NAME} PRIVATE libobs obs-frontend-api LSL::lsl freetype)# OBS::obs-frontend-api Qt::Core Qt::Widgets)
set_target_properties(
${CMAKE_PROJECT_NAME}
......@@ -77,7 +93,8 @@ target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17)
# --- End of section ---
# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
if(OS_WINDOWS OR WIN32 OR MSVC)
configure_file(cmake/bundle/windows/installer-Windows.iss.in
${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)
......@@ -85,7 +102,7 @@ if(OS_WINDOWS)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /MP /d2FH4-)
endif()
install(TARGETS ${CMAKE_PROJECT_NAME}
RUNTIME DESTINATION "${OBS_PLUGIN_DIR}")
LIBRARY DESTINATION "${OBS_PLUGIN_DIR}")
# --- End of section ---
# -- macOS specific build settings and tasks --
......
......@@ -16,17 +16,25 @@ This plugin implements an OBS filter which continuously sends the frame number o
4. launch cmake-gui
- set the source to the root of this repository
- set the build to the build directory
- you'll have to set these CMake variables (bold ones need to be set explicitly, the others are usually found automatically):
- **LIBOBS_DIR** (path) : location of the libobs subfolder in the build of OBS studio
- **OBS_FRONTEND_LIB** (filepath) : location of the obs-frontend-api.lib file
- LSL\_DIR (path) : location of liblsl share/LSL directory
- you'll have to set these CMake entries (the ones in bold must be entered manually, the others will show up when you press "configure" although you may need to do so after each time the configuration progresses)
- **LSL\_INSTALL\_ROOT** (path) : location of liblsl directory
- FREETYPE\_INCLUDE\_DIR (path) : in the <obsdependencies>/win64/include/freetype/ (the ones retrieved to build OBS studio)
- FREETYPE\_INCLUDE_DIR\_ft2build (path) : in the <obsdependencies>/win64/include/ (the ones retrieved to build OBS studio)
- FREETYPE\_LIBRARY\_RELEASE (filepath) : in the <obsdependencies>/win64/bin/freetype.lib (the ones retrieved to build OBS studio)
- LIBOBS\_DIR (path) : location of the libobs subfolder in the build folder of OBS studio source
- **LIBOBS\_INCLUDE\_DIR**: location of the libobs subfolder in root of OBS studio source
- OBS\_FRONTEND\_LIBRARY (filepath) : location of the obs-frontend-api.lib file
- **OBS\_PLUGIN\_DIR**: location where to install the plugin (should be C:/ProgramFiles/obs-studio/plugins/64bit/ )
5. configure, and if everything is okay then generate the build files
6. use the build tool you selected in cmake-gui to compile the code
KNOWN ISSUES: visual studio error LNK1181 cannot open some .lib files (obs-frontend-api.lib and freetype.lib). Problem is that the paths to these libraries are not well defined for visual studio after cmake-gui configuration (probably can be fixed in the cmakelists.txt file in the future).
Temporary solution: In visual studio go to the project properties -> Linker -> Input and edit the "Additional Dependencies" such that the two offending libraries have the full path.
#### installation
1. copy the `lsl_plugin.dll` to the appropriate folder in `<obs-studio-install-dir>/obs-plugins/`
2. copy `liblsl32/64.dll` to the same directory
3. also copy the contents of the `obsplugin/data/` directory to the `bin` directory of obs-studio (where the obs-studio.exe is located)
copy `lsl-obs-plugin.dll`, `data/Roboto-Black.tff`, `data/text-default.effect` `liblsl64.dll` to the `OBS_PLUGIN_DIR`
### Linux
On Debian/Ubuntu :
......@@ -34,13 +42,14 @@ On Debian/Ubuntu :
git clone https://gitlab.unige.ch/sims/lsl-modules/obs-plugin.git
cd obs-plugin
mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" -DCMAKE_INSTALL_PREFIX=/usr ..
cmake -DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" -DOBS_PLUGIN_DIR="<plugin installation path>" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
```
normally, `OBS_PLUGIN_DIR` in linux should be `/usr/lib/obs-plugins/`
#### installation
1. Copy the `lsl_plugin.so` to /usr/lib/obs-plugins/
2. also copy the contents of the `obsplugin/data/` directory to the `bin` directory of obs-studio (where the obs-studio executable is located)
```
sudo make install
```
## Using the plugin
This plugin implements a source in obs. To use, add the LSL plugin source and adjust settings as desired.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment