obsproject / obs-plugintemplate

GNU General Public License v2.0
307 stars 142 forks source link

CMake: Make UI dependencies optional and synchronise project settings #34

Closed PatTheMav closed 2 years ago

PatTheMav commented 2 years ago

Description

Makes requirement of Qt and obs-frontend-api optional by requiring the CMake option ENABLE_GUI to be set (which is OFF by default) and also improve generation of Xcode projects for macOS development.

Additionally the same compiler settings as used on the main repo have been moved into the CMake helper function, with a few settings removed from the main CMake script.

If a developer wants to dive into the default settings, the helper script has received extensive descriptive comments.

Motivation and Context

Reduce unnecessary dependencies on Qt and the frontend-api for plugins that don't need it and improve code documentation.

How Has This Been Tested?

Configured and build the plugintemplate with Xcode locally.

Types of changes

Checklist:

tytan652 commented 2 years ago

Plugin developer can make plugins using the Frontend API without using Qt.

And most plugin having UI feature can't have them disabled, so adding an ENABLE_UI option is strange.

PatTheMav commented 2 years ago

@tytan652 all green now - pls review.

PatTheMav commented 2 years ago

Plugin developer can make plugins using the Frontend API without using Qt.

And most plugin having UI feature can't have them disabled, so adding an ENABLE_UI option is strange.

Alternatively we could use two options, USE_QT and USE_FRONTEND_API that enable them explicitly?

tytan652 commented 2 years ago

Alternatively we could use two options, USE_QT and USE_FRONTEND_API that enable them explicitly?

I don't think CMake options are meant to configure the template, this why I took the approach of comment out some lines and explain that if the developer what to use this, he just had to uncomment it.

Options are more meant for packagers and user that build plugin themselves.

PatTheMav commented 2 years ago

Alternatively we could use two options, USE_QT and USE_FRONTEND_API that enable them explicitly?

I don't think CMake options are meant to configure the template, this why I took the approach of comment out some lines and explain that if the developer what to use this, he just had to uncomment it.

Options are more meant for packagers and user that build plugin themselves.

More or less applied your approach now.

PatTheMav commented 2 years ago

@tytan652 any more change requests from your end? Feel free to resolve open conversations accordingly.

tytan652 commented 2 years ago

any more change requests from your end?

I don't have any

Feel free to resolve open conversations accordingly.

Github provide the button only to org member and PR author.

PatTheMav commented 2 years ago

Applied fixes as requested.