From 30199e8ab7e05f5370fc28261c9dc72352fb0c1a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 26 Jan 2022 11:34:47 +0100 Subject: CMake: Use big resources in some examples Update CMake project files for examples that use exampleresources/textures.qrc to use big resources. This avoids too much memory load on the compiler process. Pick-to: 6.2 6.3 Fixes: QTBUG-100201 Change-Id: Iba933361f66ccb459f6fd1b36774748117b9655c Reviewed-by: Qt CI Bot Reviewed-by: Kai Koehne --- examples/qt3d/lights/CMakeLists.txt | 38 ++---------------------------- examples/qt3d/pbr-materials/CMakeLists.txt | 38 ++---------------------------- examples/qt3d/phong-cubes/CMakeLists.txt | 38 ++---------------------------- 3 files changed, 6 insertions(+), 108 deletions(-) (limited to 'examples') diff --git a/examples/qt3d/lights/CMakeLists.txt b/examples/qt3d/lights/CMakeLists.txt index 2ff727721..9606bc369 100644 --- a/examples/qt3d/lights/CMakeLists.txt +++ b/examples/qt3d/lights/CMakeLists.txt @@ -74,43 +74,9 @@ qt6_add_resources(lights "obj" FILES ${obj_resource_files} ) -set(textures_resource_files - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_normal.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_roughness.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_basecolor.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_metallic.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_normal.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_roughness.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_ambient_occlusion.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_basecolor.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_metallic.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_normal.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_roughness.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_basecolor.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_metallic.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_normal.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_roughness.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_basecolor.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_metallic.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_normal.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_roughness.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_basecolor.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_metallic.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_normal.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_roughness.png" - "../exampleresources/assets/textures/no-ao.png" -) -qt6_add_resources(lights "textures" - PREFIX - "/" - BASE - "../exampleresources" - FILES - ${textures_resource_files} -) +qt6_add_big_resources(big_resources ../exampleresources/textures.qrc) +target_sources(lights PRIVATE ${big_resources}) install(TARGETS lights RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/pbr-materials/CMakeLists.txt b/examples/qt3d/pbr-materials/CMakeLists.txt index d75d0f2ca..dfbd1c4fa 100644 --- a/examples/qt3d/pbr-materials/CMakeLists.txt +++ b/examples/qt3d/pbr-materials/CMakeLists.txt @@ -94,43 +94,9 @@ qt6_add_resources(pbr-materials "obj" FILES ${obj_resource_files} ) -set(textures_resource_files - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_normal.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_roughness.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_basecolor.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_metallic.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_normal.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_roughness.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_ambient_occlusion.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_basecolor.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_metallic.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_normal.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_roughness.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_basecolor.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_metallic.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_normal.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_roughness.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_basecolor.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_metallic.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_normal.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_roughness.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_basecolor.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_metallic.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_normal.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_roughness.png" - "../exampleresources/assets/textures/no-ao.png" -) -qt6_add_resources(pbr-materials "textures" - PREFIX - "/" - BASE - "../exampleresources" - FILES - ${textures_resource_files} -) +qt6_add_big_resources(big_resources ../exampleresources/textures.qrc) +target_sources(pbr-materials PRIVATE ${big_resources}) install(TARGETS pbr-materials RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/qt3d/phong-cubes/CMakeLists.txt b/examples/qt3d/phong-cubes/CMakeLists.txt index b9ce2c46b..512cb91a9 100644 --- a/examples/qt3d/phong-cubes/CMakeLists.txt +++ b/examples/qt3d/phong-cubes/CMakeLists.txt @@ -57,43 +57,9 @@ qt6_add_resources(phong-cubes "phong-cubes" FILES ${phong-cubes_resource_files} ) -set(textures_resource_files - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_normal.png" - "../exampleresources/assets/textures/aluminium_random_brushed/aluminium_random_brushed_roughness.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_basecolor.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_metallic.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_normal.png" - "../exampleresources/assets/textures/american_walnut_crown_cut/american_walnut_crown_cut_roughness.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_ambient_occlusion.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_basecolor.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_metallic.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_normal.png" - "../exampleresources/assets/textures/ceramic_small_diamond/ceramic_small_diamond_roughness.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_basecolor.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_metallic.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_normal.png" - "../exampleresources/assets/textures/ceramic_tiles_brown_tomato/ceramic_tiles_brown_tomato_roughness.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_basecolor.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_metallic.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_normal.png" - "../exampleresources/assets/textures/copper_brushed/copper_brushed_roughness.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_basecolor.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_metallic.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_normal.png" - "../exampleresources/assets/textures/gold_leaf_waste/gold_leaf_waste_roughness.png" - "../exampleresources/assets/textures/no-ao.png" -) -qt6_add_resources(phong-cubes "textures" - PREFIX - "/" - BASE - "../exampleresources" - FILES - ${textures_resource_files} -) +qt6_add_big_resources(big_resources ../exampleresources/textures.qrc) +target_sources(phong-cubes PRIVATE ${big_resources}) install(TARGETS phong-cubes RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" -- cgit v1.2.3