2021-04-26 15:46:11 +00:00
cmake_minimum_required ( VERSION 3.16...3.20 )
2021-08-30 10:08:09 +00:00
# Version variables
2021-03-08 11:56:43 +00:00
project ( obs-websocket VERSION 5.0.0 )
2021-04-27 21:52:48 +00:00
set ( OBS_WEBSOCKET_RPC_VERSION 1 )
2021-03-08 11:56:43 +00:00
2021-08-30 10:08:09 +00:00
# Set correct version string
if ( DEFINED OBS_WEBSOCKET_VERSION_SUFFIX AND NOT OBS_WEBSOCKET_VERSION_SUFFIX STREQUAL "" )
set ( OBS_WEBSOCKET_VERSION "${CMAKE_PROJECT_VERSION}${OBS_WEBSOCKET_VERSION_SUFFIX}" )
message ( WARNING "-----------------------------------\nVersion Suffix provided. OBS_WEBSOCKET_VERSION is now ${OBS_WEBSOCKET_VERSION}\n-----------------------------------" )
else ( )
set ( OBS_WEBSOCKET_VERSION "${CMAKE_PROJECT_VERSION}" )
endif ( )
2021-04-26 15:46:11 +00:00
set ( CMAKE_CXX_STANDARD 17 )
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
2021-08-30 10:08:09 +00:00
2021-04-26 15:46:11 +00:00
# Prohibit in-source builds
file ( TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" _LOC_PATH )
if ( EXISTS "${LOC_PATH}" )
message ( FATAL_ERROR "obs-websocket: You cannot build in a source directory (or any directory with "
" C M a k e L i s t s . t x t f i l e ) . P l e a s e m a k e a b u i l d s u b d i r e c t o r y . F e e l f r e e t o "
" r e m o v e C M a k e C a c h e . t x t a n d C M a k e F i l e s . " )
endif ( )
unset ( _LOC_PATH )
# Allow selection of common build types via UI
if ( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
" O B S b u i l d t y p e [ R e l e a s e , R e l W i t h D e b I n f o , D e b u g , M i n S i z e R e l ] " F O R C E )
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo Debug MinSizeRel )
endif ( )
2021-12-15 10:06:31 +00:00
# Plugin tests flag
option ( PLUGIN_TESTS "Enable plugin runtime tests" OFF )
2021-04-26 15:46:11 +00:00
# Qt build stuff
2021-03-08 11:56:43 +00:00
set ( CMAKE_PREFIX_PATH "${QTDIR}" )
set ( CMAKE_INCLUDE_CURRENT_DIR ON )
set ( CMAKE_AUTOMOC ON )
set ( CMAKE_AUTOUIC ON )
2021-06-06 06:06:36 +00:00
set ( CMAKE_AUTORCC ON ) # For resources.qrc
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# Tell websocketpp not to use system boost
2021-03-08 11:56:43 +00:00
add_definitions ( -DASIO_STANDALONE )
2021-04-26 15:46:11 +00:00
# Arm build fixes
2021-03-08 11:56:43 +00:00
if ( ${ CMAKE_SYSTEM_PROCESSOR } MATCHES "arm" )
2021-04-26 15:46:11 +00:00
set ( CMAKE_CXX_FLAGS "-mfpu=neon" )
2021-03-08 11:56:43 +00:00
endif ( )
2021-04-26 15:46:11 +00:00
# Find libobs
2021-03-08 11:56:43 +00:00
if ( WIN32 OR APPLE )
2021-04-26 15:46:11 +00:00
include ( cmake/FindLibObs.cmake )
2021-03-08 11:56:43 +00:00
endif ( )
find_package ( LibObs REQUIRED )
2021-04-26 15:46:11 +00:00
# Find Qt5
2021-09-25 01:11:31 +00:00
find_package ( Qt5 REQUIRED COMPONENTS Core Widgets Svg Network )
2021-04-26 15:46:11 +00:00
2021-04-27 16:46:00 +00:00
# Find nlohmann
set ( JSON_BuildTests OFF CACHE INTERNAL "" )
add_subdirectory ( deps/json )
2021-04-26 15:46:11 +00:00
# Configure files
configure_file (
s r c / p l u g i n - m a c r o s . h . i n
. . / s r c / p l u g i n - m a c r o s . g e n e r a t e d . h
)
configure_file (
i n s t a l l e r / i n s t a l l e r - w i n d o w s . i s s . i n
. . / i n s t a l l e r / i n s t a l l e r - w i n d o w s . g e n e r a t e d . i s s
)
# Inlude sources
2021-03-08 11:56:43 +00:00
set ( obs-websocket_SOURCES
2021-04-27 02:59:50 +00:00
s r c / o b s - w e b s o c k e t . c p p
2021-04-27 19:51:58 +00:00
s r c / C o n f i g . c p p
2021-11-20 09:26:50 +00:00
s r c / W e b S o c k e t A p i . c p p
2021-11-18 08:29:28 +00:00
s r c / w e b s o c k e t s e r v e r / W e b S o c k e t S e r v e r . c p p
s r c / w e b s o c k e t s e r v e r / W e b S o c k e t S e r v e r _ P r o t o c o l . c p p
s r c / w e b s o c k e t s e r v e r / r p c / W e b S o c k e t S e s s i o n . c p p
2021-06-15 06:00:33 +00:00
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ G e n e r a l . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ C o n f i g . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ S c e n e s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ I n p u t s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ T r a n s i t i o n s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ F i l t e r s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ O u t p u t s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ S c e n e I t e m s . c p p
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r _ M e d i a I n p u t s . c p p
2021-04-27 19:51:58 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r . c p p
2021-12-14 03:05:50 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t B a t c h H a n d l e r . c p p
2021-06-15 06:00:33 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ G e n e r a l . c p p
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ C o n f i g . c p p
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ S o u r c e s . c p p
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ S c e n e s . c p p
2021-08-27 02:09:52 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ I n p u t s . c p p
2021-12-22 23:57:57 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ T r a n s i t i o n s . c p p
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ F i l t e r s . c p p
2021-09-03 02:29:13 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ S c e n e I t e m s . c p p
2021-08-27 02:09:52 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ S t r e a m . c p p
2021-11-17 08:29:33 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ R e c o r d . c p p
2021-11-17 09:17:40 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ M e d i a I n p u t s . c p p
2021-12-28 03:09:16 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r _ U i . c p p
2021-04-27 19:51:58 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t . c p p
2021-12-14 03:05:50 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t B a t c h R e q u e s t . c p p
2021-06-15 06:00:33 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t R e s u l t . c p p
2021-04-27 19:51:58 +00:00
s r c / f o r m s / S e t t i n g s D i a l o g . c p p
2021-06-15 06:00:33 +00:00
s r c / f o r m s / C o n n e c t I n f o . c p p
s r c / f o r m s / r e s o u r c e s . q r c
2021-08-27 02:09:52 +00:00
s r c / u t i l s / C r y p t o . c p p
2021-04-28 00:24:40 +00:00
s r c / u t i l s / J s o n . c p p
2021-06-15 06:00:33 +00:00
s r c / u t i l s / O b s . c p p
2021-12-19 05:40:49 +00:00
s r c / u t i l s / O b s _ S t r i n g H e l p e r . c p p
s r c / u t i l s / O b s _ E n u m H e l p e r . c p p
s r c / u t i l s / O b s _ N u m b e r H e l p e r . c p p
2021-12-19 05:54:29 +00:00
s r c / u t i l s / O b s _ A r r a y H e l p e r . c p p
2021-12-19 05:50:00 +00:00
s r c / u t i l s / O b s _ O b j e c t H e l p e r . c p p
2021-12-19 05:40:49 +00:00
s r c / u t i l s / O b s _ S e a r c h H e l p e r . c p p
s r c / u t i l s / O b s _ A c t i o n H e l p e r . c p p
2021-12-21 09:58:20 +00:00
s r c / u t i l s / O b s _ V o l u m e M e t e r . c p p
2021-08-27 02:09:52 +00:00
s r c / u t i l s / P l a t f o r m . c p p
2021-09-25 01:11:31 +00:00
s r c / u t i l s / C o m p a t . c p p
2021-06-15 06:00:33 +00:00
d e p s / q r / c p p / Q r C o d e . c p p )
2021-03-08 11:56:43 +00:00
set ( obs-websocket_HEADERS
2021-04-27 02:59:50 +00:00
s r c / o b s - w e b s o c k e t . h
2021-04-27 19:51:58 +00:00
s r c / C o n f i g . h
2021-11-20 09:26:50 +00:00
s r c / W e b S o c k e t A p i . h
2021-11-18 08:29:28 +00:00
s r c / w e b s o c k e t s e r v e r / W e b S o c k e t S e r v e r . h
2021-11-21 08:42:21 +00:00
s r c / w e b s o c k e t s e r v e r / t y p e s / W e b S o c k e t C l o s e C o d e . h
s r c / w e b s o c k e t s e r v e r / t y p e s / W e b S o c k e t O p C o d e . h
2021-11-18 08:29:28 +00:00
s r c / w e b s o c k e t s e r v e r / r p c / W e b S o c k e t S e s s i o n . h
2021-06-15 06:00:33 +00:00
s r c / e v e n t h a n d l e r / E v e n t H a n d l e r . h
s r c / e v e n t h a n d l e r / t y p e s / E v e n t S u b s c r i p t i o n . h
2021-04-27 19:51:58 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t H a n d l e r . h
2021-12-14 03:05:50 +00:00
s r c / r e q u e s t h a n d l e r / R e q u e s t B a t c h H a n d l e r . h
2021-11-21 11:13:53 +00:00
s r c / r e q u e s t h a n d l e r / t y p e s / R e q u e s t S t a t u s . h
2021-12-11 05:38:18 +00:00
s r c / r e q u e s t h a n d l e r / t y p e s / R e q u e s t B a t c h E x e c u t i o n T y p e . h
2021-04-27 19:51:58 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t . h
2021-12-14 03:05:50 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t B a t c h R e q u e s t . h
2021-06-15 06:00:33 +00:00
s r c / r e q u e s t h a n d l e r / r p c / R e q u e s t R e s u l t . h
2021-04-27 19:51:58 +00:00
s r c / f o r m s / S e t t i n g s D i a l o g . h
2021-06-15 06:00:33 +00:00
s r c / f o r m s / C o n n e c t I n f o . h
2021-08-27 02:00:48 +00:00
s r c / u t i l s / C r y p t o . h
2021-08-27 02:09:52 +00:00
s r c / u t i l s / J s o n . h
s r c / u t i l s / O b s . h
2021-12-21 09:58:20 +00:00
s r c / u t i l s / O b s _ V o l u m e M e t e r . h
s r c / u t i l s / O b s _ V o l u m e M e t e r _ H e l p e r s . h
2021-08-27 02:00:48 +00:00
s r c / u t i l s / P l a t f o r m . h
2021-09-25 01:11:31 +00:00
s r c / u t i l s / C o m p a t . h
2021-05-08 08:42:06 +00:00
s r c / u t i l s / U t i l s . h
2021-11-20 09:26:50 +00:00
l i b / o b s - w e b s o c k e t - a p i . h
2021-06-15 06:00:33 +00:00
d e p s / q r / c p p / Q r C o d e . h p p )
2021-04-26 15:46:11 +00:00
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# Platform-independent build settings
2021-03-08 11:56:43 +00:00
add_library ( obs-websocket MODULE
$ { o b s - w e b s o c k e t _ S O U R C E S }
$ { o b s - w e b s o c k e t _ H E A D E R S } )
include_directories (
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / U I / o b s - f r o n t e n d - a p i "
$ { Q t 5 C o r e _ I N C L U D E S }
$ { Q t 5 W i d g e t s _ I N C L U D E S }
2021-06-15 06:00:33 +00:00
$ { Q t 5 S v g _ I N C L U D E S }
$ { Q t 5 N e t w o r k _ I N C L U D E S }
2021-03-08 11:56:43 +00:00
" $ { C M A K E _ S O U R C E _ D I R } / d e p s / a s i o / a s i o / i n c l u d e "
" $ { C M A K E _ S O U R C E _ D I R } / d e p s / w e b s o c k e t p p " )
target_link_libraries ( obs-websocket
l i b o b s
Q t 5 : : C o r e
2021-04-26 15:46:11 +00:00
Q t 5 : : W i d g e t s
2021-06-15 06:00:33 +00:00
Q t 5 : : S v g
Q t 5 : : N e t w o r k
2021-04-27 19:51:58 +00:00
n l o h m a n n _ j s o n : : n l o h m a n n _ j s o n )
2021-03-08 11:56:43 +00:00
2021-12-15 10:06:31 +00:00
if ( PLUGIN_TESTS )
target_compile_definitions ( obs-websocket PRIVATE PLUGIN_TESTS )
endif ( )
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# Windows-specific build settings and tasks
2021-03-08 11:56:43 +00:00
if ( WIN32 )
if ( NOT DEFINED OBS_FRONTEND_LIB )
set ( OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library" )
2021-04-26 15:46:11 +00:00
message ( FATAL_ERROR "Could not find OBS Frontend API's library!" )
2021-03-08 11:56:43 +00:00
endif ( )
2021-04-26 15:46:11 +00:00
if ( MSVC )
# Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL)
add_definitions ( /MP /d2FH4- )
endif ( )
2021-03-08 11:56:43 +00:00
add_definitions ( -D_WEBSOCKETPP_CPP11_STL_ )
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( ARCH_NAME "64bit" )
set ( OBS_BUILDDIR_ARCH "build64" )
else ( )
set ( ARCH_NAME "32bit" )
set ( OBS_BUILDDIR_ARCH "build32" )
endif ( )
include_directories (
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / $ { O B S _ B U I L D D I R _ A R C H } / U I "
)
target_link_libraries ( obs-websocket
" $ { O B S _ F R O N T E N D _ L I B } " )
2021-04-26 15:46:11 +00:00
# Release package helper
2021-03-08 11:56:43 +00:00
# The "release" folder has a structure similar OBS' one on Windows
set ( RELEASE_DIR "${PROJECT_SOURCE_DIR}/release" )
add_custom_command ( TARGET obs-websocket POST_BUILD
2021-04-26 15:46:11 +00:00
# If config is Release or RelWithDebInfo, package release files
C O M M A N D i f $ < O R : $ < C O N F I G : R e l e a s e > , $ < C O N F I G : R e l W i t h D e b I n f o > > = = 1 (
2021-03-08 11:56:43 +00:00
" $ { C M A K E _ C O M M A N D } " - E m a k e _ d i r e c t o r y
2021-04-26 15:46:11 +00:00
" $ { R E L E A S E _ D I R } / o b s - p l u g i n s / $ { A R C H _ N A M E } "
)
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
C O M M A N D i f $ < O R : $ < C O N F I G : R e l e a s e > , $ < C O N F I G : R e l W i t h D e b I n f o > > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E c o p y _ d i r e c t o r y
2021-03-08 11:56:43 +00:00
" $ { P R O J E C T _ S O U R C E _ D I R } / d a t a "
2021-04-26 15:46:11 +00:00
" $ { R E L E A S E _ D I R } / d a t a / o b s - p l u g i n s / o b s - w e b s o c k e t "
)
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
C O M M A N D i f $ < O R : $ < C O N F I G : R e l e a s e > , $ < C O N F I G : R e l W i t h D e b I n f o > > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E c o p y
2021-03-08 11:56:43 +00:00
" $ < T A R G E T _ F I L E : o b s - w e b s o c k e t > "
2021-04-26 15:46:11 +00:00
" $ { R E L E A S E _ D I R } / o b s - p l u g i n s / $ { A R C H _ N A M E } "
)
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# In Release or RelWithDebInfo mode, copy Qt image format plugins
C O M M A N D i f $ < O R : $ < C O N F I G : R e l e a s e > , $ < C O N F I G : R e l W i t h D e b I n f o > > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E m a k e _ d i r e c t o r y
" $ { R E L E A S E _ D I R } / b i n / $ { A R C H _ N A M E } / i m a g e f o r m a t s "
)
C O M M A N D i f $ < O R : $ < C O N F I G : R e l e a s e > , $ < C O N F I G : R e l W i t h D e b I n f o > > = = 1 (
2021-03-08 11:56:43 +00:00
" $ { C M A K E _ C O M M A N D } " - E c o p y
2021-04-26 15:46:11 +00:00
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q i c n s . d l l "
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q i c o . d l l "
2021-03-08 11:56:43 +00:00
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q j p e g . d l l "
2021-04-26 15:46:11 +00:00
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q t i f f . d l l "
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q w b m p . d l l "
" $ { Q T D I R } / p l u g i n s / i m a g e f o r m a t s / q w e b p . d l l "
" $ { R E L E A S E _ D I R } / b i n / $ { A R C H _ N A M E } / i m a g e f o r m a t s "
)
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# If config is RelWithDebInfo, package PDB file for target
2021-03-08 11:56:43 +00:00
C O M M A N D i f $ < C O N F I G : R e l W i t h D e b I n f o > = = 1 (
2021-04-26 15:46:11 +00:00
" $ { C M A K E _ C O M M A N D } " - E c o p y
2021-03-08 11:56:43 +00:00
" $ < T A R G E T _ P D B _ F I L E : o b s - w e b s o c k e t > "
2021-04-26 15:46:11 +00:00
" $ { R E L E A S E _ D I R } / o b s - p l u g i n s / $ { A R C H _ N A M E } "
)
2021-03-08 11:56:43 +00:00
2021-04-26 15:46:11 +00:00
# In the Debug configuration, copy to obs-studio dev environment for immediate testing
2021-03-08 11:56:43 +00:00
C O M M A N D i f $ < C O N F I G : D e b u g > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E c o p y
" $ < T A R G E T _ F I L E : o b s - w e b s o c k e t > "
2021-04-26 15:46:11 +00:00
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / $ { O B S _ B U I L D D I R _ A R C H } / r u n d i r / $ < C O N F I G > / o b s - p l u g i n s / $ { A R C H _ N A M E } "
)
2021-03-08 11:56:43 +00:00
C O M M A N D i f $ < C O N F I G : D e b u g > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E c o p y
2021-04-26 15:46:11 +00:00
" $ < T A R G E T _ P D B _ F I L E : o b s - w e b s o c k e t > "
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / $ { O B S _ B U I L D D I R _ A R C H } / r u n d i r / $ < C O N F I G > / o b s - p l u g i n s / $ { A R C H _ N A M E } "
)
2021-03-08 11:56:43 +00:00
C O M M A N D i f $ < C O N F I G : D e b u g > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E m a k e _ d i r e c t o r y
2021-04-26 15:46:11 +00:00
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / $ { O B S _ B U I L D D I R _ A R C H } / r u n d i r / $ < C O N F I G > / d a t a / o b s - p l u g i n s / o b s - w e b s o c k e t "
)
2021-03-08 11:56:43 +00:00
C O M M A N D i f $ < C O N F I G : D e b u g > = = 1 (
" $ { C M A K E _ C O M M A N D } " - E c o p y _ d i r e c t o r y
2021-04-26 15:46:11 +00:00
" $ { P R O J E C T _ S O U R C E _ D I R } / d a t a "
" $ { L I B O B S _ I N C L U D E _ D I R } / . . / $ { O B S _ B U I L D D I R _ A R C H } / r u n d i r / $ < C O N F I G > / d a t a / o b s - p l u g i n s / o b s - w e b s o c k e t "
)
2021-03-08 11:56:43 +00:00
)
endif ( )
2021-04-26 15:46:11 +00:00
# Linux-specific build settings and tasks
2021-03-08 11:56:43 +00:00
if ( UNIX AND NOT APPLE )
include ( GNUInstallDirs )
2021-11-20 10:34:48 +00:00
target_compile_options ( obs-websocket PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers )
2021-03-08 11:56:43 +00:00
set_target_properties ( obs-websocket PROPERTIES PREFIX "" )
target_link_libraries ( obs-websocket obs-frontend-api )
2021-04-26 15:46:11 +00:00
# Manually set permissions for locales
2021-03-08 11:56:43 +00:00
file ( GLOB locale_files data/locale/*.ini )
2021-04-26 15:46:11 +00:00
set ( CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
2021-03-08 11:56:43 +00:00
O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D G R O U P _ W R I T E G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E )
2021-04-26 15:46:11 +00:00
# Manually set file permissions for binary
install ( TARGETS obs-websocket LIBRARY
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ F U L L _ L I B D I R } / o b s - p l u g i n s "
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E G R O U P _ R E A D W O R L D _ R E A D )
# OBS on Ubuntu installs into a different directory than most linux distros
2021-03-08 11:56:43 +00:00
if ( ${ USE_UBUNTU_FIX } )
install ( TARGETS obs-websocket LIBRARY
D E S T I N A T I O N " / u s r / l i b / o b s - p l u g i n s "
P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E G R O U P _ R E A D W O R L D _ R E A D )
endif ( )
install ( FILES ${ locale_files }
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ F U L L _ D A T A R O O T D I R } / o b s / o b s - p l u g i n s / o b s - w e b s o c k e t / l o c a l e " )
endif ( )
2021-04-26 15:46:11 +00:00
# MacOS-specific build settings and tasks
2021-03-08 11:56:43 +00:00
if ( APPLE )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default" )
set ( CMAKE_SKIP_RPATH TRUE )
set_target_properties ( obs-websocket PROPERTIES PREFIX "" )
target_link_libraries ( obs-websocket "${OBS_FRONTEND_LIB}" )
endif ( )