From 3b067973741d7d1f74e049241d0358a10fd1d618 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 12 Sep 2024 11:31:04 +0200 Subject: [PATCH] QmlProject: Use FetchContent_Populate for CMake 3.3 Since CMake 3.30, FetchContent_Populate() with only one argument is deprecated, and will generate a configure time warning. We use FetchContent_MakeAvailable instead which already includes the add_subdirectory. Task-number: QDS-13600 Change-Id: I8c1ed45468e620813c66f4981753c046526531dc Reviewed-by: Knud Dollereder --- .../qmlprojectexporter/templates/qmlcomponents.tpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmlprojectmanager/qmlprojectexporter/templates/qmlcomponents.tpl b/src/plugins/qmlprojectmanager/qmlprojectexporter/templates/qmlcomponents.tpl index cf1d159a7e1..feb6797f9f1 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectexporter/templates/qmlcomponents.tpl +++ b/src/plugins/qmlprojectmanager/qmlprojectexporter/templates/qmlcomponents.tpl @@ -14,7 +14,13 @@ FetchContent_Declare( ) FetchContent_GetProperties(ds) -FetchContent_Populate(ds) + +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.30") + FetchContent_MakeAvailable(ds) +else () + FetchContent_Populate(ds) + add_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR}) +endif() target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE QuickStudioComponentsplugin @@ -29,8 +35,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE QuickStudioUtilsplugin ) -add_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR}) - target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE BUILD_QDS_COMPONENTS=true )