change cmakelist to qt6

This commit is contained in:
zergud 2023-01-17 00:37:23 +03:00
parent b2a577c838
commit cdc17b488f
9 changed files with 22 additions and 22 deletions

View File

@ -23,7 +23,7 @@ ENDIF()
message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX} message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX}
${qucs-suite_BINARY_DIR}" ) ${qucs-suite_BINARY_DIR}" )
FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets LinguistTools REQUIRED ) FIND_PACKAGE( Qt6 COMPONENTS Core Gui Widgets LinguistTools REQUIRED )
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})

View File

@ -54,20 +54,20 @@ endif()
# #
ADD_DEFINITIONS( -DHAVE_CONFIG_H ) ADD_DEFINITIONS( -DHAVE_CONFIG_H )
FIND_PACKAGE( Qt5 COMPONENTS Core Gui Widgets Svg Xml PrintSupport REQUIRED) FIND_PACKAGE( Qt6 COMPONENTS Core Gui Widgets Svg Xml PrintSupport REQUIRED)
#INCLUDE( ${QT_USE_FILE} ) #INCLUDE( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${Qt5Core_INCLUDE_DIRS} ${Qt6Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS} ${Qt6Svg_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS} ${Qt6Xml_INCLUDE_DIRS}
${Qt5Script_INCLUDE_DIRS} ${Qt6Script_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS} ${Qt6PrintSupport_INCLUDE_DIRS}
) )
# bug, the find package does not seem to set the QT_LIBRARIES, do it manually # bug, the find package does not seem to set the QT_LIBRARIES, do it manually
SET(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5Script_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ) SET(QT_LIBRARIES ${Qt6Core_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Svg_LIBRARIES} ${Qt6Script_LIBRARIES} ${Qt6PrintSupport_LIBRARIES} )
@ -97,11 +97,11 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ) INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ") # enable warning level SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ") # enable warning level
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") # enable C++11 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 ") # enable C++11 c++0x
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ") # enable C++11 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ") # enable C++11
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt6Widgets_EXECUTABLE_COMPILE_FLAGS}")
# For some reason, on Windows QT_LIBRARIES point to static(?) .a libs # For some reason, on Windows QT_LIBRARIES point to static(?) .a libs
# which do not provide the needed symbols. They are found on # which do not provide the needed symbols. They are found on
# the .dll libraries. # the .dll libraries.
@ -177,13 +177,13 @@ SET(QUCS_MOC_HDRS
# #
# headers that need to be moc'ed # headers that need to be moc'ed
# #
QT5_WRAP_CPP( QUCS_MOC_SRCS ${QUCS_MOC_HDRS} ) Qt6_WRAP_CPP( QUCS_MOC_SRCS ${QUCS_MOC_HDRS} )
# #
# generate rules for building source files from bitmap resources # generate rules for building source files from bitmap resources
# #
SET(RESOURCES qucs.qrc) SET(RESOURCES qucs.qrc)
QT5_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES}) Qt6_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)

View File

@ -266,7 +266,7 @@ optimizedialog.h
spicefile.h spicefile.h
) )
QT5_WRAP_CPP(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS}) QT6_WRAP_CPP(COMPONENTS_MOC_SRCS ${COMPONENTS_MOC_HDRS})
ADD_LIBRARY(components STATIC ${COMPONENTS_HDRS} ${COMPONENTS_SRCS} ${COMPONENTS_MOC_SRCS} ) ADD_LIBRARY(components STATIC ${COMPONENTS_HDRS} ${COMPONENTS_SRCS} ${COMPONENTS_MOC_SRCS} )

View File

@ -35,6 +35,6 @@ diagramdialog.h
markerdialog.h markerdialog.h
) )
QT5_WRAP_CPP( DIAGRAMS_MOC_SRCS ${DIAGRAMS_MOC_HDRS} ) QT6_WRAP_CPP( DIAGRAMS_MOC_SRCS ${DIAGRAMS_MOC_HDRS} )
ADD_LIBRARY(diagrams STATIC ${DIAGRAMS_HDRS} ${DIAGRAMS_SRCS} ${DIAGRAMS_MOC_SRCS}) ADD_LIBRARY(diagrams STATIC ${DIAGRAMS_HDRS} ${DIAGRAMS_SRCS} ${DIAGRAMS_MOC_SRCS})

View File

@ -70,8 +70,8 @@ SET(DIALOGS_UIC_HDRS
searchdialog.ui searchdialog.ui
) )
QT5_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} ) QT6_WRAP_CPP( DIALOGS_MOC_SRCS ${DIALOGS_MOC_HDRS} )
QT5_WRAP_UI( DIALOGS_UIC_SRCS ${DIALOGS_UIC_HDRS} ) QT6_WRAP_UI( DIALOGS_UIC_SRCS ${DIALOGS_UIC_HDRS} )
ADD_LIBRARY(dialogs STATIC ${DIALOGS_HDRS} ${DIALOGS_SRCS} ${DIALOGS_MOC_SRCS} ${DIALOGS_UIC_SRCS}) ADD_LIBRARY(dialogs STATIC ${DIALOGS_HDRS} ${DIALOGS_SRCS} ${DIALOGS_MOC_SRCS} ${DIALOGS_UIC_SRCS})

View File

@ -44,7 +44,7 @@ customsimdialog.h
simsettingsdialog.h simsettingsdialog.h
) )
QT5_WRAP_CPP( EXTSIMKERNELS_MOC_SRCS ${EXTSIMKERNELS_MOC_HDRS} ) QT6_WRAP_CPP( EXTSIMKERNELS_MOC_SRCS ${EXTSIMKERNELS_MOC_HDRS} )
ADD_LIBRARY(extsimkernels STATIC ${EXTSIMKERNELS_HDRS} ${EXTSIMKERNELS_SRCS} ${EXTSIMKERNELS_MOC_SRCS}) ADD_LIBRARY(extsimkernels STATIC ${EXTSIMKERNELS_HDRS} ${EXTSIMKERNELS_SRCS} ${EXTSIMKERNELS_MOC_SRCS})

View File

@ -39,7 +39,7 @@ graphictextdialog.h
id_dialog.h id_dialog.h
) )
QT5_WRAP_CPP( PAINTINGS_MOC_SRCS ${PAINTINGS_MOC_HDRS} ) QT6_WRAP_CPP( PAINTINGS_MOC_SRCS ${PAINTINGS_MOC_HDRS} )
ADD_LIBRARY(paintings STATIC ${PAINTINGS_HDRS} ${PAINTINGS_SRCS} ${PAINTINGS_MOC_SRCS} ) ADD_LIBRARY(paintings STATIC ${PAINTINGS_HDRS} ${PAINTINGS_SRCS} ${PAINTINGS_MOC_SRCS} )

View File

@ -31,6 +31,6 @@ q3scrollview.h
q3frame.h q3frame.h
) )
QT5_WRAP_CPP( QT3_COMPAT_SRCS ${QT3_COMPAT_MOC_HDRS} ) QT6_WRAP_CPP( QT3_COMPAT_SRCS ${QT3_COMPAT_MOC_HDRS} )
ADD_LIBRARY(qt3_compat STATIC ${QT3_COMPAT_HDRS} ${QT3_COMPAT_SRCS}) ADD_LIBRARY(qt3_compat STATIC ${QT3_COMPAT_HDRS} ${QT3_COMPAT_SRCS})

View File

@ -15,9 +15,9 @@ file (GLOB TRANSLATIONS_FILES qucs_*.ts)
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts" "OFF") option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts" "OFF")
IF (UPDATE_TRANSLATIONS) IF (UPDATE_TRANSLATIONS)
QT5_CREATE_TRANSLATION ( QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES}) QT6_CREATE_TRANSLATION ( QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
ELSE (UPDATE_TRANSLATIONS) ELSE (UPDATE_TRANSLATIONS)
QT5_ADD_TRANSLATION ( QM_FILES ${TRANSLATIONS_FILES}) QT6_ADD_TRANSLATION ( QM_FILES ${TRANSLATIONS_FILES})
ENDIF (UPDATE_TRANSLATIONS) ENDIF (UPDATE_TRANSLATIONS)
ADD_CUSTOM_TARGET (translations ALL DEPENDS ${QM_FILES}) ADD_CUSTOM_TARGET (translations ALL DEPENDS ${QM_FILES})