diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 13d81a0a94b..ccba5909d3f 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -774,19 +774,6 @@ function(finalize_qtc_gtest test_name exclude_sources_regex) endforeach() endfunction() -# This is the CMake equivalent of "RESOURCES = $$files()" from qmake -function(qtc_glob_resources) - cmake_parse_arguments(_arg "" "QRC_FILE;ROOT;GLOB" "" ${ARGN}) - - file(GLOB_RECURSE fileList RELATIVE "${_arg_ROOT}" "${_arg_ROOT}/${_arg_GLOB}") - set(qrcData "\n") - foreach(file IN LISTS fileList) - string(APPEND qrcData " ${_arg_ROOT}/${file}\n") - endforeach() - string(APPEND qrcData "") - file(WRITE "${_arg_QRC_FILE}" "${qrcData}") -endfunction() - function(qtc_copy_to_builddir custom_target_name) cmake_parse_arguments(_arg "CREATE_SUBDIRS" "DESTINATION" "FILES;DIRECTORIES" ${ARGN}) set(timestampFiles) diff --git a/src/plugins/studiowelcome/CMakeLists.txt b/src/plugins/studiowelcome/CMakeLists.txt index c82b4fa2361..b04caf2a6d4 100644 --- a/src/plugins/studiowelcome/CMakeLists.txt +++ b/src/plugins/studiowelcome/CMakeLists.txt @@ -1,11 +1,3 @@ -set(qmlQrcFile "${CMAKE_CURRENT_BINARY_DIR}/StudioWelcome_qml.qrc") - -qtc_glob_resources( - QRC_FILE "${qmlQrcFile}" - ROOT "${CMAKE_CURRENT_SOURCE_DIR}" - GLOB "qml/*" -) - add_qtc_plugin(StudioWelcome DEPENDS Qt5::QuickWidgets PLUGIN_DEPENDS Core ProjectExplorer QtSupport @@ -14,8 +6,15 @@ add_qtc_plugin(StudioWelcome studiowelcomeplugin.cpp studiowelcomeplugin.h studiowelcome_global.h studiowelcome.qrc - ${qmlQrcFile} "${PROJECT_SOURCE_DIR}/src/share/3rdparty/studiofonts/studiofonts.qrc" EXTRA_TRANSLATIONS qml ) + +if (TARGET StudioWelcome) + file(GLOB_RECURSE qmlfiles + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + qml/* + ) + qtc_add_resources(StudioWelcome StudioWelcome_qml FILES ${qmlfiles}) +endif()