cMake: Add support for compiling against Qt6 (#7647)

Removes the BUILD_QT5 flag and adds a new FREECAD_QT_VERSION option,
which can be set to either "Auto" (default), 5, or 6. Auto detects which
version of Qt is installed on the system and chooses it. If both version
are installed, Qt5 is used.

Note that this DOES NOT implement compiling against Qt6, it only adds
the necessary cMake infrastructure to begin work on the source code
changes that will be required.
This commit is contained in:
Chris Hennes
2022-10-31 09:24:09 -05:00
committed by GitHub
parent b64d987ac1
commit 1fac3fead0
37 changed files with 595 additions and 662 deletions

View File

@@ -56,17 +56,11 @@ else(MSVC)
)
endif(MSVC)
if (BUILD_QT5)
include_directories(
${Qt5Core_INCLUDE_DIRS}
)
list(APPEND FreeCADBase_LIBS ${Qt5Core_LIBRARIES})
else()
include_directories(
${QT_QTCORE_INCLUDE_DIR}
)
list(APPEND FreeCADBase_LIBS ${QT_QTCORE_LIBRARY})
endif()
include_directories(
${QtCore_INCLUDE_DIRS}
)
list(APPEND FreeCADBase_LIBS ${QtCore_LIBRARIES})
if (BUILD_DYNAMIC_LINK_PYTHON)
list(APPEND FreeCADBase_LIBS ${PYTHON_LIBRARIES})