Skip to content
Snippets Groups Projects
Commit b4052f81 authored by Jim's avatar Jim
Browse files

Add cmake option to disable user interface

Adds:
ENABLE_UI (on by default) which makes it so that the UI is required, and
will fail if a dependency is not found.  This is on by default because
most people are building it with the user interface, and we'll probably
get a lot of issue reports stating "why is there no executable?" if we
don't have this on by default.

DISABLE_UI which forces the UI off.

If neither are set, then the UI will only be built if the dependencies
for it are found, otherwise the UI will be be ignored.
parent 978ff008
No related branches found
No related tags found
No related merge requests found
project(obs)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
option(ENABLE_UI "Enables the OBS user interfaces" ON)
if(DISABLE_UI)
message(STATUS "UI disabled")
return()
elseif(ENABLE_UI)
set(FIND_MODE REQUIRED)
else()
set(_lib_suffix 32)
set(FIND_MODE QUIET)
endif()
if(DEFINED ENV{QTDIR${_lib_suffix}})
......@@ -17,8 +19,25 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
set(CMAKE_AUTOMOC TRUE)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
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")
if(WIN32)
set(obs_PLATFORM_SOURCES
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment