CMake: configurejson2cmake: Do not generate useless OPTIONALs

Do not set properties of packages to type OPTIONAL. That is the default
anyway.

Update generator script and generated files.

Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Tobias Hunger 2019-05-03 14:08:17 +02:00 committed by Simon Hausmann
parent d8cdbc4f97
commit 9618434de5
8 changed files with 4 additions and 42 deletions

View File

@ -7,11 +7,8 @@
#### Libraries
qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB)
set_package_properties(ZLIB PROPERTIES TYPE OPTIONAL)
qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD)
set_package_properties(ZSTD PROPERTIES TYPE OPTIONAL)
qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev)
set_package_properties(Libudev PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -11,23 +11,15 @@ set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu)
#### Libraries
qt_find_package(GLIB2 PROVIDED_TARGETS GLIB2::GLIB2)
set_package_properties(GLIB2 PROPERTIES TYPE OPTIONAL)
qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data)
set_package_properties(ICU PROPERTIES TYPE OPTIONAL)
qt_find_package(Libsystemd)
set_package_properties(Libsystemd PROPERTIES TYPE OPTIONAL)
qt_find_package(Atomic PROVIDED_TARGETS Atomic)
set_package_properties(Atomic PROPERTIES TYPE OPTIONAL)
qt_find_package(WrapRt PROVIDED_TARGETS WrapRt)
set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL)
qt_find_package(LTTngUST)
set_package_properties(LTTngUST PROPERTIES TYPE OPTIONAL)
qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2)
set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED)
qt_find_package(PPS)
set_package_properties(PPS PROPERTIES TYPE OPTIONAL)
qt_find_package(Slog2)
set_package_properties(Slog2 PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -23,45 +23,26 @@ set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system)
#### Libraries
qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2)
set_package_properties(ATSPI2 PROPERTIES TYPE OPTIONAL)
qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm)
set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL)
qt_find_package(EGL)
set_package_properties(EGL PROPERTIES TYPE OPTIONAL)
qt_find_package(Freetype PROVIDED_TARGETS Freetype::Freetype)
set_package_properties(Freetype PROPERTIES TYPE REQUIRED)
qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig)
set_package_properties(Fontconfig PROPERTIES TYPE OPTIONAL)
qt_find_package(gbm PROVIDED_TARGETS gbm::gbm)
set_package_properties(gbm PROPERTIES TYPE OPTIONAL)
qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz)
set_package_properties(harfbuzz PROPERTIES TYPE OPTIONAL)
qt_find_package(Libinput PROVIDED_TARGETS Libinput::Libinput)
set_package_properties(Libinput PROPERTIES TYPE OPTIONAL)
qt_find_package(JPEG)
set_package_properties(JPEG PROPERTIES TYPE OPTIONAL)
qt_find_package(PNG PROVIDED_TARGETS PNG::PNG)
set_package_properties(PNG PROPERTIES TYPE OPTIONAL)
qt_find_package(Mtdev PROVIDED_TARGETS PkgConfig::Mtdev)
set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL)
qt_find_package(OpenGL PROVIDED_TARGETS OpenGL::GL OpenGL::OpenGL OpenGL::EGL OpenGL::GLX OpenGL::GLU)
set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL)
qt_find_package(OpenGL)
qt_find_package(GLESv2)
set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL)
qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib)
set_package_properties(Tslib PROPERTIES TYPE OPTIONAL)
qt_find_package(Vulkan PROVIDED_TARGETS Vulkan::Vulkan)
set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL)
qt_find_package(Vulkan)
qt_find_package(Wayland)
set_package_properties(Wayland PROPERTIES TYPE OPTIONAL)
qt_find_package(X11)
set_package_properties(X11 PROPERTIES TYPE OPTIONAL)
qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB)
set_package_properties(XCB PROPERTIES TYPE OPTIONAL)
qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB)
set_package_properties(X11_XCB PROPERTIES TYPE OPTIONAL)
qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB)
set_package_properties(XKB PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -7,9 +7,7 @@
#### Libraries
qt_find_package(Libproxy PROVIDED_TARGETS PkgConfig::Libproxy)
set_package_properties(Libproxy PROPERTIES TYPE OPTIONAL)
qt_find_package(OpenSSL)
set_package_properties(OpenSSL PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -7,11 +7,8 @@
#### Libraries
qt_find_package(PostgreSQL PROVIDED_TARGETS PostgreSQL::PostgreSQL)
set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL)
qt_find_package(ODBC PROVIDED_TARGETS ODBC::ODBC)
set_package_properties(ODBC PROPERTIES TYPE OPTIONAL)
qt_find_package(SQLite3)
set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -7,7 +7,6 @@
#### Libraries
qt_find_package(Cups PROVIDED_TARGETS Cups::Cups)
set_package_properties(Cups PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -7,7 +7,6 @@
#### Libraries
qt_find_package(GTK3)
set_package_properties(GTK3 PROPERTIES TYPE OPTIONAL)
#### Tests

View File

@ -270,9 +270,8 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set):
else:
cm_fh.write('qt_find_package({})\n'.format(newlib))
cm_fh.write('set_package_properties({} PROPERTIES TYPE {})\n'
.format(newlib, 'REQUIRED' if isRequired else 'OPTIONAL')
)
if isRequired:
cm_fh.write('set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(newlib))
def lineify(label, value, quote=True):
if value: