Warning, /frameworks/extra-cmake-modules/modules/QtVersionOption.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
0002 #
0003 # SPDX-License-Identifier: BSD-3-Clause
0004 
0005 #[=======================================================================[.rst:
0006 QtVersionOption
0007 ---------------
0008 
0009 Adds a build option to select the major Qt version if necessary,
0010 that is, if the major Qt version has not yet been determined otherwise
0011 (e.g. by a corresponding ``find_package()`` call).
0012 This module is typically included by other modules requiring knowledge
0013 about the major Qt version.
0014 
0015 ``QT_MAJOR_VERSION`` is defined to either be "5" or "6".
0016 
0017 Since 5.82.0.
0018 #]=======================================================================]
0019 
0020 if (DEFINED QT_MAJOR_VERSION)
0021     return()
0022 endif()
0023 
0024 if (TARGET Qt5::Core)
0025     set(QT_MAJOR_VERSION 5)
0026 elseif (TARGET Qt6::Core)
0027     set(QT_MAJOR_VERSION 6)
0028 else()
0029     option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
0030 
0031     if (BUILD_WITH_QT6)
0032         set(QT_MAJOR_VERSION 6)
0033     else()
0034         set(QT_MAJOR_VERSION 5)
0035     endif()
0036 endif()