CMake: Require pre-created targets for qt_add_openapi_client
Currently qt_add_openapi_client creates the main and common library
targets if they don't yet exist.
This mostly follows what qt_add_qml_module does.
This potentially bloats the API with various options that might be
needed to configure the behavior and creation of the main and
common library targets.
In the future the API might have to deal with Qml modules and plugins
as well. The API would have to support creation options for 4
different kinds of targets: main target, common target, qml backing
target, qml plugin target.
Having repeated options for these would be cumbersome.
Instead, force the user of qt_add_openapi_client to pre-create the
targets with the desired options, and just pass their names.
If we change our minds, we can still change the API later in a
compatible way by adding new options to pre-create the targets.
Doing the reverse would not be possible.
Change-Id: I6561309d88b0e35831238f1f36e3fff2ba25fd31
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>