2018-09-25 23:17:08 +00:00
|
|
|
# Experimental new Sources, Filters and Transitions for OBS Studio
|
|
|
|
# Copyright (C) 2017 - 2018 Michael Fabian Dirks
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
2017-06-28 21:21:42 +00:00
|
|
|
|
2018-04-24 10:31:43 +00:00
|
|
|
# CMake Setup
|
2019-04-19 05:15:18 +00:00
|
|
|
CMake_Minimum_Required(VERSION 3.8.0)
|
2018-09-25 23:17:08 +00:00
|
|
|
Include("cmake/util.cmake")
|
2017-11-02 23:30:53 +00:00
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
# Automatic Versioning
|
|
|
|
Set(VERSION_MAJOR 0)
|
2019-04-02 21:08:01 +00:00
|
|
|
Set(VERSION_MINOR 6)
|
2019-04-03 04:45:10 +00:00
|
|
|
Set(VERSION_PATCH 1)
|
2018-09-25 23:17:08 +00:00
|
|
|
Set(VERSION_TWEAK 0)
|
|
|
|
Set(PROJECT_COMMIT "N/A")
|
|
|
|
If(EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
|
|
|
|
Set(GIT_RESULT "")
|
|
|
|
Set(GIT_OUTPUT "")
|
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND git rev-list --count --topo-order ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}..HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
RESULT_VARIABLE GIT_RESULT
|
|
|
|
OUTPUT_VARIABLE GIT_OUTPUT
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
|
|
|
)
|
|
|
|
If(GIT_RESULT EQUAL 0)
|
|
|
|
Set(VERSION_TWEAK ${GIT_OUTPUT})
|
|
|
|
EndIf()
|
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND git rev-parse HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
RESULT_VARIABLE GIT_RESULT
|
|
|
|
OUTPUT_VARIABLE GIT_OUTPUT
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
|
|
|
)
|
|
|
|
If(GIT_RESULT EQUAL 0)
|
|
|
|
Set(PROJECT_COMMIT ${GIT_OUTPUT})
|
|
|
|
EndIf()
|
|
|
|
EndIf()
|
2018-04-24 10:31:43 +00:00
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
# Define Project
|
|
|
|
PROJECT(
|
|
|
|
obs-stream-effects
|
|
|
|
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_TWEAK}
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
set(PROJECT_FULL_NAME "Stream Effects for OBS Studio")
|
2019-02-11 02:55:06 +00:00
|
|
|
set(PROJECT_DESCRIPTION "New Sources, Filters and Transitions for OBS Studio")
|
2018-12-23 19:49:18 +00:00
|
|
|
set(PROJECT_AUTHORS "Michael Fabian 'Xaymar' Dirks <info@xaymar.com>")
|
|
|
|
set(PROJECT_COPYRIGHT_YEARS "2018")
|
2017-06-28 21:21:42 +00:00
|
|
|
|
2017-11-02 23:30:53 +00:00
|
|
|
################################################################################
|
2018-12-23 19:49:18 +00:00
|
|
|
# Setup / Bootstrap
|
2017-11-02 23:30:53 +00:00
|
|
|
################################################################################
|
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
# Detect Build Type
|
2018-12-23 19:49:18 +00:00
|
|
|
if("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
|
|
|
|
set(PropertyPrefix "")
|
|
|
|
else()
|
|
|
|
set(PropertyPrefix "${PROJECT_NAME}_")
|
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
|
|
|
# Detect Architecture
|
|
|
|
math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}")
|
2018-12-23 19:49:18 +00:00
|
|
|
if("${BITS}" STREQUAL "32")
|
|
|
|
set(ARCH "x86")
|
|
|
|
else()
|
|
|
|
set(ARCH "x64")
|
|
|
|
endif()
|
2017-11-02 23:30:53 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
# Search Path
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# CMake / Compiler
|
|
|
|
################################################################################
|
2018-09-25 23:17:08 +00:00
|
|
|
|
|
|
|
# Configure Version Header
|
2018-12-23 19:49:18 +00:00
|
|
|
configure_file(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/version.hpp.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/source/version.hpp"
|
|
|
|
)
|
|
|
|
configure_file(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/module.cpp.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/source/module.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
if(WIN32)
|
2019-02-02 05:33:28 +00:00
|
|
|
## Installer (InnoSetup)
|
|
|
|
Configure_File(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/installer.iss.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/installer.iss"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Windows Specific Resource Definition
|
2018-12-23 19:49:18 +00:00
|
|
|
set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}")
|
|
|
|
set(PROJECT_COMPANY_NAME "${PROJECT_AUTHORS}")
|
|
|
|
set(PROJECT_COPYRIGHT "${PROJECT_AUTHORS} © ${PROJECT_COPYRIGHT_YEARS}")
|
|
|
|
set(PROJECT_LEGAL_TRADEMARKS_1 "")
|
|
|
|
set(PROJECT_LEGAL_TRADEMARKS_2 "")
|
2018-09-25 23:22:54 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
configure_file(
|
2018-09-25 23:17:08 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/version.rc.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/cmake/version.rc"
|
|
|
|
@ONLY
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
|
|
|
# All Warnings, Extra Warnings, Pedantic
|
2019-04-19 07:42:15 +00:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
# using Clang
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum")
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
|
|
# GCC: -fpermissive is required as GCC does not allow the same template to be in different namespaces.
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers")
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
|
|
|
# using Intel C++
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
2018-09-25 23:17:08 +00:00
|
|
|
# Force to always compile with W4
|
2018-12-23 19:49:18 +00:00
|
|
|
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
|
|
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2019-01-14 10:23:21 +00:00
|
|
|
# C++ Standard and Extensions
|
2019-04-19 05:15:18 +00:00
|
|
|
## Use C++17 and no non-standard extensions.
|
|
|
|
SET(_CXX_STANDARD 17)
|
|
|
|
SET(_CXX_EXTENSIONS OFF)
|
2019-01-14 10:23:21 +00:00
|
|
|
|
2018-04-24 10:31:43 +00:00
|
|
|
################################################################################
|
2018-09-25 23:17:08 +00:00
|
|
|
# Options
|
2018-04-24 10:31:43 +00:00
|
|
|
################################################################################
|
2018-12-23 19:49:18 +00:00
|
|
|
set(${PropertyPrefix}OBS_NATIVE FALSE CACHE BOOL "Use native obs-studio build" FORCE)
|
|
|
|
set(${PropertyPrefix}OBS_REFERENCE FALSE CACHE BOOL "Use referenced obs-studio build" FORCE)
|
|
|
|
set(${PropertyPrefix}OBS_PACKAGE FALSE CACHE BOOL "Use packaged obs-studio build" FORCE)
|
|
|
|
set(${PropertyPrefix}OBS_DOWNLOAD FALSE CACHE BOOL "Use downloaded obs-studio build" FORCE)
|
|
|
|
mark_as_advanced(FORCE OBS_NATIVE OBS_PACKAGE OBS_REFERENCE OBS_DOWNLOAD)
|
2018-04-24 10:31:43 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
if(NOT TARGET libobs)
|
|
|
|
set(${PropertyPrefix}OBS_STUDIO_DIR "" CACHE PATH "OBS Studio Source/Package Directory")
|
|
|
|
set(${PropertyPrefix}OBS_DOWNLOAD_VERSION "22.0.2" CACHE STRING "OBS Studio Version to download")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT ${PropertyPrefix}OBS_NATIVE)
|
|
|
|
set(${PropertyPrefix}OBS_DEPENDENCIES_DIR "" CACHE PATH "Path to OBS Dependencies")
|
|
|
|
set(CMAKE_PACKAGE_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Path for generated archives.")
|
|
|
|
set(CMAKE_PACKAGE_NAME "${PROJECT_NAME}" CACHE STRING "Name for the generated archives.")
|
|
|
|
set(CMAKE_PACKAGE_SUFFIX_OVERRIDE "" CACHE STRING "Override for the suffix.")
|
|
|
|
endif()
|
2018-04-24 10:31:43 +00:00
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
################################################################################
|
|
|
|
# Dependencies
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Detect OBS Studio Type
|
2018-12-23 19:49:18 +00:00
|
|
|
if(TARGET libobs)
|
|
|
|
message(STATUS "${PROJECT_NAME}: Using native obs-studio.")
|
2018-09-25 23:17:08 +00:00
|
|
|
CacheSet(${PropertyPrefix}OBS_NATIVE TRUE)
|
2018-12-23 19:49:18 +00:00
|
|
|
else()
|
2018-09-25 23:17:08 +00:00
|
|
|
CacheSet(${PropertyPrefix}OBS_NATIVE FALSE)
|
2018-12-23 19:49:18 +00:00
|
|
|
if(EXISTS "${OBS_STUDIO_DIR}/cmake/LibObs/LibObsConfig.cmake")
|
|
|
|
message(STATUS "${PROJECT_NAME}: Using packaged obs-studio.")
|
2018-09-25 23:17:08 +00:00
|
|
|
CacheSet(${PropertyPrefix}OBS_PACKAGE TRUE)
|
2018-12-23 19:49:18 +00:00
|
|
|
elseif(EXISTS "${OBS_STUDIO_DIR}/libobs/obs-module.h")
|
|
|
|
message(STATUS "${PROJECT_NAME}: Using referenced obs-studio.")
|
2018-09-25 23:17:08 +00:00
|
|
|
CacheSet(${PropertyPrefix}OBS_REFERENCE TRUE)
|
2018-12-23 19:49:18 +00:00
|
|
|
else()
|
|
|
|
message(STATUS "${PROJECT_NAME}: No OBS Studio detected, using downloadable prebuilt binaries.")
|
2018-09-25 23:17:08 +00:00
|
|
|
CacheSet(${PropertyPrefix}OBS_DOWNLOAD TRUE)
|
2018-12-23 19:49:18 +00:00
|
|
|
set(${PropertyPrefix}OBS_DOWNLOAD_URL "https://github.com/Xaymar/obs-studio/releases/download/${OBS_DOWNLOAD_VERSION}/obs-studio-${ARCH}-vs2017.7z")
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
# CMake Modules
|
|
|
|
if(${PropertyPrefix}OBS_DOWNLOAD)
|
|
|
|
include("cmake/DownloadProject.cmake")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Load OBS Studio
|
|
|
|
if(${PropertyPrefix}OBS_NATIVE)
|
|
|
|
option(BUILD_FFMPEG_ENCODER "Build AMD Encoder module" ON)
|
|
|
|
if (NOT BUILD_FFMPEG_ENCODER)
|
|
|
|
message(STATUS "Not building AMD Encoder")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
elseif(${PropertyPrefix}OBS_PACKAGE)
|
|
|
|
include("${OBS_STUDIO_DIR}/cmake/LibObs/LibObsConfig.cmake")
|
|
|
|
elseif(${PropertyPrefix}OBS_REFERENCE)
|
|
|
|
set(obsPath "${OBS_STUDIO_DIR}")
|
2019-01-14 17:58:56 +00:00
|
|
|
include("${OBS_STUDIO_DIR}/cmake/external/FindLibobs.cmake")
|
2018-12-23 19:49:18 +00:00
|
|
|
elseif(${PropertyPrefix}OBS_DOWNLOAD)
|
2018-09-25 23:17:08 +00:00
|
|
|
download_project(
|
|
|
|
PROJ libobs
|
|
|
|
URL ${OBS_DOWNLOAD_URL}
|
|
|
|
UPDATE_DISCONNECTED 1
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
include("${libobs_SOURCE_DIR}/cmake/LibObs/LibObsConfig.cmake")
|
|
|
|
else()
|
|
|
|
message(CRITICAL "Impossible case reached, verify system stability.")
|
|
|
|
return()
|
|
|
|
endif()
|
2018-04-24 10:31:43 +00:00
|
|
|
|
2017-06-28 21:21:42 +00:00
|
|
|
################################################################################
|
|
|
|
# Code
|
|
|
|
################################################################################
|
2018-09-25 23:17:08 +00:00
|
|
|
SET(PROJECT_DATA_LOCALE
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/locale/en-US.ini"
|
|
|
|
)
|
|
|
|
SET(PROJECT_DATA_EFFECTS
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/color-conversion.effect"
|
2018-12-22 21:07:33 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/displace.effect"
|
2018-09-30 19:54:10 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/mask.effect"
|
2018-09-27 04:09:43 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/mipgen.effect"
|
2019-04-02 01:03:35 +00:00
|
|
|
|
|
|
|
# Blur
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/blur/box.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/blur/box-linear.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/blur/dual-filtering.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/blur/gaussian.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/blur/gaussian-linear.effect"
|
2019-04-06 17:37:26 +00:00
|
|
|
|
|
|
|
# Signed Distance Field
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/sdf/sdf-producer.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/effects/sdf/sdf-consumer.effect"
|
2018-09-25 23:17:08 +00:00
|
|
|
)
|
|
|
|
SET(PROJECT_DATA_SHADERS
|
|
|
|
# "${PROJECT_SOURCE_DIR}/data/shaders/name.effect"
|
|
|
|
"${PROJECT_SOURCE_DIR}/data/shaders/filter/example.effect"
|
|
|
|
)
|
2019-02-11 02:54:16 +00:00
|
|
|
SET(PROJECT_DATA
|
|
|
|
${PROJECT_DATA_LOCALE}
|
|
|
|
${PROJECT_DATA_EFFECTS}
|
|
|
|
${PROJECT_DATA_SHADERS}
|
|
|
|
)
|
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
SET(PROJECT_LIBRARIES
|
|
|
|
)
|
2019-02-11 02:54:16 +00:00
|
|
|
|
2019-02-11 05:26:06 +00:00
|
|
|
SET(PROJECT_TEMPLATES
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/version.hpp.in"
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/module.cpp.in"
|
|
|
|
)
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND PROJECT_TEMPLATES
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/installer.iss.in"
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/version.rc.in"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
SET(PROJECT_PUBLIC
|
|
|
|
)
|
2019-02-11 02:54:16 +00:00
|
|
|
SET(PROJECT_PRIVATE_GENERATED
|
2018-12-23 19:49:18 +00:00
|
|
|
"${PROJECT_BINARY_DIR}/source/module.cpp"
|
|
|
|
"${PROJECT_BINARY_DIR}/source/version.hpp"
|
2019-02-11 02:54:16 +00:00
|
|
|
)
|
|
|
|
SET(PROJECT_PRIVATE_SOURCE
|
|
|
|
|
|
|
|
# Plugin
|
2019-01-14 10:23:21 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/plugin.hpp"
|
2018-09-25 23:17:08 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/plugin.cpp"
|
2019-01-14 10:23:21 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/strings.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/utility.hpp"
|
2018-04-28 23:02:05 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/utility.cpp"
|
2018-11-08 07:07:49 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-event.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-event.cpp"
|
2019-01-14 10:23:21 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-math.hpp"
|
2017-12-13 23:28:35 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-math.cpp"
|
2019-01-14 10:23:21 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-memory.hpp"
|
2018-01-08 09:52:53 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/util-memory.cpp"
|
2019-02-11 02:54:16 +00:00
|
|
|
|
|
|
|
# Graphics
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-effect-source.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-effect-source.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-source-texture.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-source-texture.cpp"
|
2019-04-02 01:03:35 +00:00
|
|
|
# Graphics/Blur
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-base.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-base.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box-linear.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box-linear.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-dual-filtering.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-dual-filtering.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian-linear.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian-linear.cpp"
|
2019-04-02 02:37:37 +00:00
|
|
|
|
2019-02-11 02:54:16 +00:00
|
|
|
# OBS
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-helper.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-helper.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-indexbuffer.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-indexbuffer.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-limits.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-mipmapper.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-mipmapper.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-rendertarget.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-rendertarget.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-sampler.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-sampler.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-texture.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-texture.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertex.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertex.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertexbuffer.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertexbuffer.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-tools.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-tools.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-source.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-source.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-tracker.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-tracker.cpp"
|
|
|
|
|
|
|
|
# Sources
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/sources/source-mirror.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/sources/source-mirror.cpp"
|
|
|
|
|
|
|
|
# Filters
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-blur.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-blur.cpp"
|
2019-04-02 02:37:37 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-custom-shader.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-custom-shader.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-displacement.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-displacement.cpp"
|
2019-02-11 02:54:16 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-sdf-effects.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-sdf-effects.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-transform.hpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source/filters/filter-transform.cpp"
|
|
|
|
|
|
|
|
# Transitions
|
|
|
|
)
|
|
|
|
set(PROJECT_PRIVATE
|
|
|
|
${PROJECT_DATA}
|
|
|
|
${PROJECT_PRIVATE_GENERATED}
|
|
|
|
${PROJECT_PRIVATE_SOURCE}
|
2017-09-17 19:55:16 +00:00
|
|
|
)
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2019-02-11 02:54:16 +00:00
|
|
|
source_group(TREE "${PROJECT_SOURCE_DIR}/data" PREFIX "Data Files" FILES ${PROJECT_DATA})
|
|
|
|
source_group(TREE "${PROJECT_BINARY_DIR}/source" PREFIX "Generated Files" FILES ${PROJECT_PRIVATE_GENERATED})
|
2019-02-11 05:26:06 +00:00
|
|
|
source_group(TREE "${PROJECT_SOURCE_DIR}/cmake" PREFIX "Template Files" FILES ${PROJECT_TEMPLATES})
|
2019-02-11 02:54:16 +00:00
|
|
|
|
|
|
|
# Filter Sources
|
|
|
|
set(_TMP_SOURCE ${PROJECT_PRIVATE_SOURCE})
|
|
|
|
list(FILTER _TMP_SOURCE INCLUDE REGEX "\.(c|cpp)$")
|
|
|
|
source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Source Files" FILES ${_TMP_SOURCE})
|
|
|
|
|
|
|
|
# Filter Headers
|
|
|
|
set(_TMP_HEADER ${PROJECT_PRIVATE_SOURCE})
|
|
|
|
list(FILTER _TMP_HEADER INCLUDE REGEX "\.(h|hpp)$")
|
|
|
|
source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Header Files" FILES ${_TMP_HEADER})
|
2017-06-28 21:21:42 +00:00
|
|
|
|
|
|
|
################################################################################
|
2018-09-25 23:17:08 +00:00
|
|
|
# Target
|
2017-06-28 21:21:42 +00:00
|
|
|
################################################################################
|
2018-12-23 19:49:18 +00:00
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} MODULE
|
2018-09-25 23:17:08 +00:00
|
|
|
${PROJECT_PUBLIC}
|
|
|
|
${PROJECT_PRIVATE}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Include Directories
|
2018-12-23 19:49:18 +00:00
|
|
|
target_include_directories(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
PUBLIC
|
|
|
|
PRIVATE
|
2017-06-28 21:21:42 +00:00
|
|
|
"${PROJECT_BINARY_DIR}/source"
|
|
|
|
"${PROJECT_SOURCE_DIR}/source"
|
2018-12-23 19:49:18 +00:00
|
|
|
${FFMPEG_INCLUDE_DIRS}
|
2018-09-25 23:17:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# OBS Studio
|
2018-12-23 19:49:18 +00:00
|
|
|
if(${PropertyPrefix}OBS_NATIVE)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
libobs
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
elseif(${PropertyPrefix}OBS_REFERENCE)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
PRIVATE
|
|
|
|
"${OBS_STUDIO_DIR}/libobs"
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
"${LIBOBS_LIB}"
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
elseif(${PropertyPrefix}OBS_PACKAGE)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
PRIVATE
|
|
|
|
"${OBS_STUDIO_DIR}/include"
|
2017-06-28 21:21:42 +00:00
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
libobs
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
elseif(${PropertyPrefix}OBS_DOWNLOAD)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
libobs
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
|
|
|
# Link Libraries
|
2018-12-23 19:49:18 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
"${PROJECT_LIBRARIES}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Definitions
|
2018-12-23 19:49:18 +00:00
|
|
|
if (WIN32)
|
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
PRIVATE
|
|
|
|
_CRT_SECURE_NO_WARNINGS
|
|
|
|
# windows.h
|
|
|
|
WIN32_LEAN_AND_MEAN
|
|
|
|
NOGPICAPMASKS
|
|
|
|
NOVIRTUALKEYCODES
|
2018-12-23 19:49:18 +00:00
|
|
|
#NOWINMESSAGES
|
2018-09-25 23:17:08 +00:00
|
|
|
NOWINSTYLES
|
|
|
|
NOSYSMETRICS
|
|
|
|
NOMENUS
|
|
|
|
NOICONS
|
|
|
|
NOKEYSTATES
|
|
|
|
NOSYSCOMMANDS
|
|
|
|
NORASTEROPS
|
|
|
|
NOSHOWWINDOW
|
|
|
|
NOATOM
|
|
|
|
NOCLIPBOARD
|
|
|
|
NOCOLOR
|
|
|
|
NOCTLMGR
|
|
|
|
NODRAWTEXT
|
2018-12-23 19:49:18 +00:00
|
|
|
#NOGDI
|
2018-09-25 23:17:08 +00:00
|
|
|
NOKERNEL
|
2018-09-27 04:09:43 +00:00
|
|
|
#NOUSER
|
2018-12-23 19:49:18 +00:00
|
|
|
#NONLS
|
2018-09-25 23:17:08 +00:00
|
|
|
NOMB
|
|
|
|
NOMEMMGR
|
|
|
|
NOMETAFILE
|
|
|
|
NOMINMAX
|
2018-09-27 04:09:43 +00:00
|
|
|
#NOMSG
|
2018-09-25 23:17:08 +00:00
|
|
|
NOOPENFILE
|
|
|
|
NOSCROLL
|
|
|
|
NOSERVICE
|
|
|
|
NOSOUND
|
2018-12-23 19:49:18 +00:00
|
|
|
#NOTEXTMETRIC
|
2018-09-25 23:17:08 +00:00
|
|
|
NOWH
|
|
|
|
NOWINOFFSETS
|
|
|
|
NOCOMM
|
|
|
|
NOKANJI
|
|
|
|
NOHELP
|
|
|
|
NOPROFILER
|
|
|
|
NODEFERWINDOWPOS
|
|
|
|
NOMCX
|
|
|
|
NOIME
|
|
|
|
NOMDI
|
|
|
|
NOINOUT
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2019-04-19 05:15:18 +00:00
|
|
|
# C++ Standard and Extensions
|
|
|
|
set_target_properties(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
CXX_STANDARD ${_CXX_STANDARD}
|
|
|
|
CXX_EXTENSIONS ${_CXX_EXTENSIONS}
|
|
|
|
)
|
|
|
|
|
2018-09-25 23:17:08 +00:00
|
|
|
# File Version
|
2018-12-23 19:49:18 +00:00
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(
|
2018-09-25 23:17:08 +00:00
|
|
|
${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}
|
|
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
else()
|
|
|
|
set_target_properties(
|
2018-09-25 23:17:08 +00:00
|
|
|
${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}
|
|
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2017-06-28 21:21:42 +00:00
|
|
|
################################################################################
|
2018-09-25 23:17:08 +00:00
|
|
|
# Installation
|
2017-06-28 21:21:42 +00:00
|
|
|
################################################################################
|
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
if(${PropertyPrefix}OBS_NATIVE)
|
2018-09-25 23:17:08 +00:00
|
|
|
install_obs_plugin_with_data(${PROJECT_NAME} data)
|
2018-12-23 19:49:18 +00:00
|
|
|
else()
|
|
|
|
install(
|
|
|
|
TARGETS ${PROJECT_NAME}
|
2018-09-25 23:17:08 +00:00
|
|
|
RUNTIME DESTINATION "./obs-plugins/${BITS}bit/" COMPONENT Runtime
|
|
|
|
LIBRARY DESTINATION "./obs-plugins/${BITS}bit/" COMPONENT Runtime
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
if(MSVC)
|
|
|
|
install(
|
2018-09-25 23:17:08 +00:00
|
|
|
FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
|
|
|
|
DESTINATION "./obs-plugins/${BITS}bit/"
|
|
|
|
OPTIONAL
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
install(
|
2018-09-25 23:17:08 +00:00
|
|
|
DIRECTORY "${PROJECT_SOURCE_DIR}/data/"
|
|
|
|
DESTINATION "./data/obs-plugins/${PROJECT_NAME}/"
|
|
|
|
)
|
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "")
|
|
|
|
set(PackageFullName "${CMAKE_PACKAGE_PREFIX}/${CMAKE_PACKAGE_NAME}-${PROJECT_VERSION}")
|
|
|
|
else()
|
|
|
|
set(PackageFullName "${CMAKE_PACKAGE_PREFIX}/${CMAKE_PACKAGE_NAME}-${CMAKE_PACKAGE_SUFFIX_OVERRIDE}")
|
|
|
|
endif()
|
2018-09-25 23:17:08 +00:00
|
|
|
|
2018-12-23 19:49:18 +00:00
|
|
|
add_custom_target(
|
2018-09-25 23:17:08 +00:00
|
|
|
PACKAGE_7Z
|
|
|
|
${CMAKE_COMMAND} -E tar cfv "${PackageFullName}.7z" --format=7zip --
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/obs-plugins"
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/data"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
add_custom_target(
|
2018-09-25 23:17:08 +00:00
|
|
|
PACKAGE_ZIP
|
|
|
|
${CMAKE_COMMAND} -E tar cfv "${PackageFullName}.zip" --format=zip --
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/obs-plugins"
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/data"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
|
|
|
|
)
|
2018-12-23 19:49:18 +00:00
|
|
|
endif()
|