diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,14 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED Qml Quick Gui Multimedia Core Svg Xml XmlPatterns LinguistTools Sensors) + +if(ANDROID) + find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED AndroidExtras) +endif(ANDROID) + +if(SAILFISHOS) + find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED Widgets) +endif(SAILFISHOS) find_package (KF5 QUIET COMPONENTS DocTools diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -49,18 +49,18 @@ set_source_files_properties(${gcompris_RES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() -set(used_qt_modules Qml Quick Gui Multimedia Core Svg Xml XmlPatterns Sensors) +set(used_qt_modules Qt5::Qml Qt5::Quick Qt5::Gui Qt5::Multimedia Qt5::Core Qt5::Svg Qt5::Xml Qt5::XmlPatterns Qt5::Sensors) if(ANDROID) add_library(${GCOMPRIS_EXECUTABLE_NAME} SHARED ${gcompris_SRCS}) - set(used_qt_modules ${used_qt_modules} AndroidExtras) + set(used_qt_modules ${used_qt_modules} Qt5::AndroidExtras) elseif(CMAKE_HOST_APPLE) add_executable(${GCOMPRIS_EXECUTABLE_NAME} MACOSX_BUNDLE ${gcompris_SRCS} ${gcompris_RES}) elseif(CMAKE_HOST_WIN32) add_executable(${GCOMPRIS_EXECUTABLE_NAME} WIN32 ${gcompris_SRCS} ${gcompris_RES}) elseif(SAILFISHOS) add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) - set(used_qt_modules ${used_qt_modules} Widgets) + set(used_qt_modules ${used_qt_modules} Qt5::Widgets) else() add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) endif() @@ -68,10 +68,10 @@ # only build the lib for testing purpose if(BUILD_TESTING) add_library(gcompris_core SHARED ${gcompris_SRCS}) - qt5_use_modules(gcompris_core ${used_qt_modules}) + target_link_libraries(gcompris_core ${used_qt_modules}) endif() -qt5_use_modules(${GCOMPRIS_EXECUTABLE_NAME} ${used_qt_modules}) +target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${used_qt_modules}) GCOMPRIS_ADD_RCC(core *.qml *.js resource/*.${COMPRESSED_AUDIO} resource/*.gif resource/*.png resource/*.svg resource/bonus/* resource/sounds/* resource/fonts/* qmldir COPYING)