If QT_VERSION is not defined, it gets define with the AUTO value. And its definition is moved to the helper file. find_qt now: - Check quietly for Qt5 and Qt6 - If QT_VERSION is set to AUTO. It checks firstly if Qt5 was found it will use it. If not it do the same for Qt6 - If QT_VERSION is set to 5 or 6, it checks if the choice was found and use it. And if not, it falls back to the other if found. - If neither Qt5 or Qt6 are found, a fatal error is emitted. - The macro saved the _QT_VERSION in the cache to replace QT_VERSION, so the process is not repeated each time that find_qt is used. - When Qt::Gui is in the Linux component list, Qt::GuiPrivate is added. So using the versioned one is no longer required.
62 lines
1.7 KiB
CMake
62 lines
1.7 KiB
CMake
project(decklink-captions)
|
|
|
|
if(NOT ENABLE_DECKLINK)
|
|
return()
|
|
endif()
|
|
|
|
add_library(decklink-captions MODULE)
|
|
add_library(OBS::decklink-captions ALIAS decklink-captions)
|
|
|
|
find_qt(COMPONENTS Widgets)
|
|
|
|
target_link_libraries(decklink-captions PRIVATE Qt::Widgets)
|
|
|
|
set_target_properties(
|
|
decklink-captions
|
|
PROPERTIES AUTOMOC ON
|
|
AUTOUIC ON
|
|
AUTORCC ON
|
|
AUTOUIC_SEARCH_PATHS "forms")
|
|
|
|
target_compile_features(decklink-captions PRIVATE cxx_std_17)
|
|
|
|
target_sources(decklink-captions PRIVATE forms/captions.ui)
|
|
|
|
target_sources(decklink-captions PRIVATE decklink-captions.cpp
|
|
decklink-captions.h)
|
|
|
|
target_link_libraries(decklink-captions PRIVATE OBS::frontend-api OBS::libobs)
|
|
|
|
if(OS_MACOS)
|
|
find_library(COCOA Cocoa)
|
|
mark_as_advanced(COCOA)
|
|
target_link_libraries(decklink-captions PRIVATE ${COCOA})
|
|
|
|
elseif(OS_POSIX)
|
|
find_package(X11 REQUIRED)
|
|
mark_as_advanced(X11)
|
|
target_link_libraries(decklink-captions PRIVATE X11::X11)
|
|
elseif(OS_WINDOWS)
|
|
set(MODULE_DESCRIPTION "OBS DeckLink Captions module")
|
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
|
decklink-captions.rc)
|
|
|
|
target_sources(decklink-captions PRIVATE decklink-captions.rc)
|
|
endif()
|
|
|
|
set_target_properties(decklink-captions PROPERTIES FOLDER "plugins/decklink"
|
|
PREFIX "")
|
|
|
|
get_target_property(_SOURCES decklink-captions SOURCES)
|
|
set(_UI ${_SOURCES})
|
|
list(FILTER _UI INCLUDE REGEX ".*\\.ui?")
|
|
|
|
source_group(
|
|
TREE "${CMAKE_CURRENT_SOURCE_DIR}/forms"
|
|
PREFIX "UI Files"
|
|
FILES ${_UI})
|
|
unset(_SOURCES)
|
|
unset(_UI)
|
|
|
|
setup_plugin_target(decklink-captions)
|