2014-01-20 07:58:58 -08:00
|
|
|
project(obs)
|
|
|
|
|
2014-09-15 14:20:43 -07:00
|
|
|
option(ENABLE_UI "Enables the OBS user interfaces" ON)
|
|
|
|
if(DISABLE_UI)
|
|
|
|
message(STATUS "UI disabled")
|
|
|
|
return()
|
|
|
|
elseif(ENABLE_UI)
|
|
|
|
set(FIND_MODE REQUIRED)
|
2014-01-20 07:58:58 -08:00
|
|
|
else()
|
2014-09-15 14:20:43 -07:00
|
|
|
set(FIND_MODE QUIET)
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{QTDIR${_lib_suffix}})
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR${_lib_suffix}}")
|
|
|
|
elseif(DEFINED ENV{QTDIR})
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
|
|
|
|
set(CMAKE_AUTOMOC TRUE)
|
|
|
|
|
2014-09-15 14:20:43 -07:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_lib_suffix 64)
|
|
|
|
else()
|
|
|
|
set(_lib_suffix 32)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Qt5Widgets ${FIND_MODE})
|
|
|
|
find_package(Qt5Network ${FIND_MODE})
|
|
|
|
|
|
|
|
if(NOT Qt5Widgets_FOUND OR NOT Qt5Network_FOUND)
|
|
|
|
if (ENABLE_UI)
|
|
|
|
message(FATAL_ERROR "Failed to find Qt5")
|
|
|
|
else()
|
|
|
|
message(STATUS "Qt5 not found - UI disabled")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(obs_PLATFORM_SOURCES
|
|
|
|
platform-windows.cpp)
|
|
|
|
elseif(APPLE)
|
|
|
|
set(obs_PLATFORM_SOURCES
|
|
|
|
platform-osx.mm)
|
2014-01-24 14:04:42 -08:00
|
|
|
|
|
|
|
find_package(AppKit REQUIRED)
|
2014-09-15 10:38:18 -07:00
|
|
|
set(obs_PLATFORM_LIBRARIES ${APPKIT_LIBRARIES})
|
2014-01-24 14:04:42 -08:00
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
add_definitions(-fobjc-arc)
|
2014-10-05 15:32:18 -07:00
|
|
|
|
|
|
|
option(ENABLE_SPARKLE_UPDATER "Enables updates via the Sparkle framework (don't forget to update the Info.plist for your .app)" OFF)
|
|
|
|
if(ENABLE_SPARKLE_UPDATER)
|
|
|
|
find_library(SPARKLE Sparkle)
|
|
|
|
include_directories(${SPARKLE})
|
|
|
|
set(obs_PLATFORM_SOURCES
|
|
|
|
${obs_PLATFORM_SOURCES}
|
|
|
|
sparkle-updater.mm)
|
|
|
|
set(obs_PLATFORM_LIBRARIES
|
|
|
|
${obs_PLATFORM_LIBRARIES}
|
|
|
|
${SPARKLE})
|
|
|
|
add_definitions(-DUPDATE_SPARKLE=1)
|
|
|
|
endif()
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
elseif(UNIX)
|
2014-04-03 14:41:22 -07:00
|
|
|
find_package(Qt5X11Extras REQUIRED)
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
set(obs_PLATFORM_SOURCES
|
|
|
|
platform-x11.cpp)
|
|
|
|
|
2014-12-01 23:35:42 -08:00
|
|
|
find_package(XCB COMPONENTS XCB REQUIRED RANDR REQUIRED XINERAMA REQUIRED)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${XCB_INCLUDE_DIRS}
|
|
|
|
${X11_XCB_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
add_definitions(
|
|
|
|
${XCB_DEFINITIONS}
|
|
|
|
${X11_XCB_DEFINITIONS})
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
set(obs_PLATFORM_LIBRARIES
|
2014-12-01 23:35:42 -08:00
|
|
|
${XCB_LIBRARIES}
|
|
|
|
${X11_XCB_LIBRARIES}
|
2014-05-18 18:02:57 -07:00
|
|
|
Qt5::X11Extras)
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(obs_SOURCES
|
|
|
|
${obs_PLATFORM_SOURCES}
|
|
|
|
obs-app.cpp
|
|
|
|
window-basic-main.cpp
|
2014-01-24 20:31:25 -08:00
|
|
|
window-basic-settings.cpp
|
2014-09-15 16:16:16 -07:00
|
|
|
window-basic-interaction.cpp
|
2014-03-23 01:07:54 -07:00
|
|
|
window-basic-properties.cpp
|
2014-05-10 18:47:48 -07:00
|
|
|
window-basic-source-select.cpp
|
2014-07-13 11:36:47 -07:00
|
|
|
window-license-agreement.cpp
|
2014-07-06 16:19:27 -07:00
|
|
|
window-basic-status-bar.cpp
|
UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating). I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.
I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.
There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.
If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply). If
bounds are active, it will modify the bounding box only instead.
How a source scales when a bounding box is active depends on the type of
bounds being used. You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.
Like in OBS1, objects will snap to the edges unless the control key is
pressed. However, this will now happen even if the object is rotated or
oriented in any strange way. Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 00:54:48 -07:00
|
|
|
window-basic-transform.cpp
|
|
|
|
window-basic-preview.cpp
|
2014-01-20 07:58:58 -08:00
|
|
|
window-namedialog.cpp
|
2014-05-18 17:44:10 -07:00
|
|
|
window-log-reply.cpp
|
2014-09-02 19:11:55 -07:00
|
|
|
window-remux.cpp
|
2014-03-23 01:07:54 -07:00
|
|
|
properties-view.cpp
|
2014-05-03 22:54:38 -07:00
|
|
|
volume-control.cpp
|
2014-01-20 07:58:58 -08:00
|
|
|
qt-wrappers.cpp)
|
|
|
|
|
|
|
|
set(obs_HEADERS
|
|
|
|
obs-app.hpp
|
|
|
|
platform.hpp
|
2014-01-25 08:18:40 -08:00
|
|
|
window-main.hpp
|
2014-01-20 07:58:58 -08:00
|
|
|
window-basic-main.hpp
|
2014-01-24 20:31:25 -08:00
|
|
|
window-basic-settings.hpp
|
2014-09-15 16:16:16 -07:00
|
|
|
window-basic-interaction.hpp
|
2014-03-23 01:07:54 -07:00
|
|
|
window-basic-properties.hpp
|
2014-05-10 18:47:48 -07:00
|
|
|
window-basic-source-select.hpp
|
2014-07-13 11:36:47 -07:00
|
|
|
window-license-agreement.hpp
|
2014-07-06 16:19:27 -07:00
|
|
|
window-basic-status-bar.hpp
|
UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating). I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.
I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.
There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.
If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply). If
bounds are active, it will modify the bounding box only instead.
How a source scales when a bounding box is active depends on the type of
bounds being used. You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.
Like in OBS1, objects will snap to the edges unless the control key is
pressed. However, this will now happen even if the object is rotated or
oriented in any strange way. Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 00:54:48 -07:00
|
|
|
window-basic-transform.hpp
|
|
|
|
window-basic-preview.hpp
|
2014-01-20 07:58:58 -08:00
|
|
|
window-namedialog.hpp
|
2014-05-18 17:44:10 -07:00
|
|
|
window-log-reply.hpp
|
2014-09-02 19:11:55 -07:00
|
|
|
window-remux.hpp
|
2014-03-23 01:07:54 -07:00
|
|
|
properties-view.hpp
|
|
|
|
display-helpers.hpp
|
2014-05-03 22:54:38 -07:00
|
|
|
volume-control.hpp
|
2014-01-20 07:58:58 -08:00
|
|
|
qt-display.hpp
|
|
|
|
qt-wrappers.hpp)
|
|
|
|
|
|
|
|
set(obs_UI
|
|
|
|
forms/NameDialog.ui
|
2014-07-13 11:36:47 -07:00
|
|
|
forms/OBSLicenseAgreement.ui
|
2014-05-18 17:44:10 -07:00
|
|
|
forms/OBSLogReply.ui
|
2014-01-20 07:58:58 -08:00
|
|
|
forms/OBSBasic.ui
|
UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating). I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.
I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.
There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.
If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply). If
bounds are active, it will modify the bounding box only instead.
How a source scales when a bounding box is active depends on the type of
bounds being used. You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.
Like in OBS1, objects will snap to the edges unless the control key is
pressed. However, this will now happen even if the object is rotated or
oriented in any strange way. Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 00:54:48 -07:00
|
|
|
forms/OBSBasicTransform.ui
|
2014-03-23 01:07:54 -07:00
|
|
|
forms/OBSBasicSettings.ui
|
2014-05-10 18:47:48 -07:00
|
|
|
forms/OBSBasicSourceSelect.ui
|
2014-09-15 16:16:16 -07:00
|
|
|
forms/OBSBasicInteraction.ui
|
2014-09-02 19:11:55 -07:00
|
|
|
forms/OBSBasicProperties.ui
|
|
|
|
forms/OBSRemux.ui)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
set(obs_QRC
|
|
|
|
forms/obs.qrc)
|
|
|
|
|
|
|
|
qt5_wrap_ui(obs_UI_HEADERS ${obs_UI})
|
|
|
|
qt5_add_resources(obs_QRC_SOURCES ${obs_QRC})
|
|
|
|
|
|
|
|
add_executable(obs WIN32
|
|
|
|
${obs_SOURCES}
|
|
|
|
${obs_HEADERS}
|
|
|
|
${obs_UI_HEADERS}
|
|
|
|
${obs_QRC_SOURCES})
|
2014-02-02 06:16:40 -08:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_output_suffix "64")
|
|
|
|
else()
|
|
|
|
set(_output_suffix "32")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(obs
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "obs${_output_suffix}")
|
|
|
|
endif()
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
target_link_libraries(obs
|
|
|
|
libobs
|
2014-05-18 18:02:57 -07:00
|
|
|
Qt5::Widgets
|
|
|
|
Qt5::Network
|
2014-01-20 07:58:58 -08:00
|
|
|
${obs_PLATFORM_LIBRARIES})
|
|
|
|
|
|
|
|
install_obs_core(obs)
|
2014-07-15 06:02:03 -07:00
|
|
|
install_obs_data(obs data obs-studio)
|
2014-08-02 07:12:53 -07:00
|
|
|
|
|
|
|
if (UNIX AND UNIX_STRUCTURE AND NOT APPLE)
|
|
|
|
install(FILES dist/obs.desktop DESTINATION share/applications)
|
|
|
|
install(FILES forms/images/obs.png
|
|
|
|
DESTINATION share/icons/hicolor/256x256/apps)
|
|
|
|
endif()
|