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:
@@ -37,12 +37,6 @@ if(BUILD_GUI)
|
||||
FreeCADGui
|
||||
)
|
||||
|
||||
if (MSVC AND NOT BUILD_QT5)
|
||||
list(APPEND FreeCAD_LIBS
|
||||
${QT_QTMAIN_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_DYNAMIC_LINK_PYTHON)
|
||||
# executables have to be linked against python libraries,
|
||||
# because extension modules are not.
|
||||
@@ -84,20 +78,10 @@ add_executable(FreeCADMainCmd ${FreeCADMainCmd_SRCS})
|
||||
|
||||
SET(FreeCADMainCmd_LIBS
|
||||
FreeCADApp
|
||||
${QtCore_LIBRARIES}
|
||||
${QtXml_LIBRARIES}
|
||||
)
|
||||
|
||||
if (BUILD_QT5)
|
||||
list(APPEND FreeCADMainCmd_LIBS
|
||||
${Qt5Core_LIBRARIES}
|
||||
${Qt5Xml_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
list(APPEND FreeCADMainCmd_LIBS
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTXML_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_DYNAMIC_LINK_PYTHON)
|
||||
# executables have to be linked against python libraries,
|
||||
# because extension modules are not.
|
||||
|
||||
Reference in New Issue
Block a user