base: Format CMakeLists.txt using OBS formatter

This commit is contained in:
tt2468 2022-07-25 07:48:06 -07:00
parent 1698b2895b
commit de40b53d77

View File

@ -6,11 +6,9 @@ if(NOT ENABLE_UI)
return() return()
endif() endif()
# Plugin tests flag # Plugin tests flag
option(PLUGIN_TESTS "Enable plugin runtime tests" OFF) option(PLUGIN_TESTS "Enable plugin runtime tests" OFF)
# Qt build stuff # Qt build stuff
set(CMAKE_PREFIX_PATH "${QTDIR}") set(CMAKE_PREFIX_PATH "${QTDIR}")
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -18,34 +16,29 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON) # For resources.qrc set(CMAKE_AUTORCC ON) # For resources.qrc
# Find Qt5 # Find Qt5
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Svg Network) find_package(Qt5 REQUIRED COMPONENTS Core Widgets Svg Network)
# Find nlohmann # Find nlohmann
set(JSON_BuildTests OFF CACHE INTERNAL "") set(JSON_BuildTests
OFF
CACHE INTERNAL "")
add_subdirectory(deps/json) add_subdirectory(deps/json)
# Tell websocketpp not to use system boost # Tell websocketpp not to use system boost
add_definitions(-DASIO_STANDALONE) add_definitions(-DASIO_STANDALONE)
# Configure files # Configure files
configure_file( configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-macros.h.in
${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-macros.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-macros.generated.h)
${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-macros.generated.h
)
# Setup target # Setup target
add_library(obs-websocket MODULE) add_library(obs-websocket MODULE)
add_library(OBS::websocket ALIAS obs-websocket) add_library(OBS::websocket ALIAS obs-websocket)
target_sources( target_sources(
obs-websocket PRIVATE obs-websocket
src/obs-websocket.cpp PRIVATE src/obs-websocket.cpp
src/obs-websocket.h src/obs-websocket.h
src/Config.cpp src/Config.cpp
src/Config.h src/Config.h
@ -125,16 +118,14 @@ target_sources(
deps/qr/cpp/QrCode.cpp deps/qr/cpp/QrCode.cpp
deps/qr/cpp/QrCode.hpp) deps/qr/cpp/QrCode.hpp)
target_include_directories(obs-websocket PRIVATE target_include_directories(
${Qt5Core_INCLUDES} obs-websocket
${Qt5Widgets_INCLUDES} PRIVATE ${Qt5Core_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5Svg_INCLUDES}
${Qt5Svg_INCLUDES} ${Qt5Network_INCLUDES} "deps/asio/asio/include" "deps/websocketpp")
${Qt5Network_INCLUDES}
"deps/asio/asio/include"
"deps/websocketpp")
target_link_libraries(obs-websocket PRIVATE target_link_libraries(
OBS::libobs obs-websocket
PRIVATE OBS::libobs
OBS::frontend-api OBS::frontend-api
Qt5::Core Qt5::Core
Qt5::Widgets Qt5::Widgets
@ -150,15 +141,15 @@ if(PLUGIN_TESTS)
target_compile_definitions(obs-websocket PRIVATE PLUGIN_TESTS) target_compile_definitions(obs-websocket PRIVATE PLUGIN_TESTS)
endif() endif()
# Random other things # Random other things
if(WIN32) if(WIN32)
add_definitions(-D_WEBSOCKETPP_CPP11_STL_) add_definitions(-D_WEBSOCKETPP_CPP11_STL_)
elseif(UNIX AND NOT APPLE) elseif(UNIX AND NOT APPLE)
target_compile_options(obs-websocket PRIVATE -Wall -Wextra -Wno-missing-field-initializers -Wno-variadic-macros) target_compile_options(
obs-websocket PRIVATE -Wall -Wextra -Wno-missing-field-initializers
-Wno-variadic-macros)
endif() endif()
# Final CMake helpers # Final CMake helpers
setup_plugin_target(obs-websocket) setup_plugin_target(obs-websocket)
setup_target_resources(obs-websocket "obs-plugins/obs-websocket") setup_target_resources(obs-websocket "obs-plugins/obs-websocket")