I'm currently working on a project that required Qt4, as I'm upgrading to Qt5, I tried to change the CMakeList.txt Old file :
find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
qt4_add_resources (QRC_SOURCES ${RESOURCES})
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
qt4_add_translation( TRANSLATIONS_QM ${TRANSLATIONS} )
New one :
find_package (Qt5Widgets REQUIRED)
qt5_use_modules (${QT_USE_FILE})
qt5_add_resources (QRC_SOURCES ${RESOURCES})
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
qt5_add_translation( TRANSLATIONS_QM ${TRANSLATIONS} )
The error I get is :
CMake Error at CMakeLists.txt:120 (qt5_use_modules):
qt5_use_modules Macro invoked with incorrect arguments for macro named:
qt5_use_modules
CMake Error at CMakeLists.txt:123 (qt5_add_translation):
Unknown CMake command "qt5_add_translation".
-- Configuring incomplete, errors occurred!
See also "/home/maifee/Desktop/Paint/CMakeFiles/CMakeOutput.log".
[Finished]
Complete CMakeList : https://github.com/maifeeulasad/Paint/blob/main/CMakeLists.txt#L119