obs-studio/plugins/win-ivcam/CMakeLists.txt
PatTheMav aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00

63 lines
1.8 KiB
CMake

option(ENABLE_IVCAM "Enable building with Realsense camera support" OFF)
if(NOT ENABLE_IVCAM)
obs_status(DISABLED "Realsense camera plugin support")
return()
endif()
project(win-ivcam)
find_package(RSSDK REQUIRED)
if(NOT TARGET RSS::SDK)
obs_status(FATAL_ERROR "win-ivcam -> RSSDK not found.")
endif()
include(IDLFileHelper)
add_library(win-ivcam MODULE)
add_library(OBS::ivcam ALIAS win-ivcam)
add_library(seglibrary INTERFACE)
add_library(Intel::seglibrary ALIAS seglibrary)
add_idl_files(win-ivcam_seg_library_GENERATED_FILES seg_service/seg_service.idl)
target_sources(
seglibrary
INTERFACE seg_library/Dependencies.h
seg_library/SerServer.cpp
seg_library/SegServer.h
seg_library/SegServerImpl.cpp
seg_library/SegServerImpl.h
seg_library/SegService.h
seg_library/SegImage.cpp
seg_library/SegImage.h
${win-ivcam_seg_library_GENERATED_FILES})
set(MODULE_DESCRIPTION "OBS Intel(R) RealSense(TM) module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
win-ivcam.rc)
target_sources(win-ivcam PRIVATE realsense.cpp win-ivcam.rc)
target_link_libraries(win-ivcam OBS::libobs Intel::seglibrary)
get_target_property(_SEGLIBRARY_SOURCES INTEL::seglibrary INTERFACE_SOURCES)
foreach(_SEGLIBRARY_SOURCE ${_SEGLIBRARY_SOURCES})
get_filename_component(_EXT ${_SEGLIBRARY_SOURCE} EXT)
if(${_EXT} STREQUAL "hpp" OR ${_EXT} STREQUAL "h")
source_group("seg_library\\Header Files" FILES ${_SEGLIBRARY_SOURCE})
elseif(${_EXT} STREQUAL "cpp" OR ${_EXT} STREQUAL "c")
source_group("seg_library\\Source Files" FILES ${_SEGLIBRARY_SOURCE})
endif()
endforeach()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_subdirectory(seg_service)
endif()
setup_plugin_target(win-ivcam)