2014-01-20 07:58:58 -08:00
|
|
|
project(obs)
|
|
|
|
|
2014-03-16 20:06:00 -07:00
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_lib_suffix 64)
|
|
|
|
else()
|
|
|
|
set(_lib_suffix 32)
|
|
|
|
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)
|
|
|
|
|
|
|
|
find_package(Qt5Widgets REQUIRED)
|
|
|
|
|
|
|
|
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)
|
|
|
|
set(obs_PLATFORM_LIBRARIES ${AppKit_LIBRARIES})
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
add_definitions(-fobjc-arc)
|
|
|
|
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)
|
|
|
|
|
|
|
|
find_package(X11)
|
|
|
|
include_directories(${X11_INCLUDE_DIRS} ${X11_Xinerama_INCLUDE_PATH})
|
|
|
|
|
|
|
|
if(NOT X11_Xinerama_FOUND)
|
|
|
|
message(FATAL_ERROR "Xinerama not found!")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(obs_PLATFORM_LIBRARIES
|
|
|
|
${X11_LIBRARIES}
|
|
|
|
${X11_Xinerama_LIB})
|
2014-04-03 14:41:22 -07:00
|
|
|
|
|
|
|
set(obs_PLATFORM_QT_MODULES
|
|
|
|
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-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-01-20 07:58:58 -08:00
|
|
|
window-namedialog.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-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-01-20 07:58:58 -08:00
|
|
|
window-namedialog.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
|
|
|
|
forms/OBSBasic.ui
|
2014-03-23 01:07:54 -07:00
|
|
|
forms/OBSBasicSettings.ui
|
2014-05-10 18:47:48 -07:00
|
|
|
forms/OBSBasicSourceSelect.ui
|
2014-03-23 01:07:54 -07:00
|
|
|
forms/OBSBasicProperties.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
|
|
|
|
2014-04-03 14:41:22 -07:00
|
|
|
qt5_use_modules(obs Widgets ${obs_PLATFORM_QT_MODULES})
|
2014-03-16 20:06:00 -07:00
|
|
|
|
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
|
|
|
|
${obs_PLATFORM_LIBRARIES})
|
|
|
|
|
|
|
|
install_obs_core(obs)
|
|
|
|
install_obs_data(obs ../build/data/obs-studio obs-studio)
|
2014-01-28 02:39:43 -08:00
|
|
|
|