diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..72a704c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,232 @@ +name: "Deploy" +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "deploy" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + qtarch: [wasm_singlethread, android_arm64_v8a] + qtversion: ['6.7.3'] + include: + - qtarch: wasm_singlethread + qttarget: 'wasm' + qthost: 'all_os' + qtmodules: '' + additional_build_flags: '--target install' + aqtsource: 'git+https://github.com/timangus/aqtinstall.git' + # - qtarch: wasm_multithread + # qttarget: 'desktop' + # qtmodules: '' + # additional_build_flags: '--target install' + - qtarch: android_arm64_v8a + qttarget: 'android' + qthost: 'linux' + aqtsource: 'git+https://github.com/miurahr/aqtinstall.git' + # - qtarch: android_armv7 + # qttarget: 'android' + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential ninja-build + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: mymindstorm/setup-emsdk@v13 + if: matrix.qttarget == 'wasm' + with: + version: 3.1.50 + + - name: Install Qt native version (required by android version) + uses: timangus/install-qt-action@deployed + with: + aqtsource: ${{ matrix.aqtsource }} + version: ${{ matrix.qtversion }} + host: linux + target: 'desktop' + arch: linux_gcc_64 + dir: '${{github.workspace}}/qt' + install-deps: 'true' + + - name: Set QT_HOST_PATH + run: echo "QT_HOST_PATH=${QT_ROOT_DIR}" >> "$GITHUB_ENV" + + - name: Install Qt crosscompile target version + uses: timangus/install-qt-action@deployed + with: + aqtsource: ${{ matrix.aqtsource }} + version: ${{ matrix.qtversion }} + host: ${{ matrix.qthost }} + target: ${{ matrix.qttarget }} + arch: ${{ matrix.qtarch }} + dir: '${{github.workspace}}/qt' + install-deps: 'true' + modules: ${{ matrix.qtmodules }} + + - name: Make qt cross binaries executable + run: | + chmod u+x ${QT_ROOT_DIR}/bin/* + + - name: Verify emcc + if: matrix.qttarget == 'desktop' + run: emcc -v + + - name: Set reusable strings + shell: bash + run: | + BUILD_DIR="${{ github.workspace }}/build" + APK_TARGET="appMaterialTester" + APK_PROJECT_DIR="MaterialTester" + echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_ENV + echo "APK_TARGET=$APK_TARGET" >> $GITHUB_ENV + + echo "INSTALL_DIR=${{ github.workspace }}/install/${{ matrix.qtarch }}" >> $GITHUB_ENV + echo "APK_DIR=$BUILD_DIR/android-build/build/outputs/apk/" >> $GITHUB_ENV + echo "ANDROID_BUILD_DIR=$BUILD_DIR/android-build/" >> $GITHUB_ENV + echo "DEPLOYMENT_SETTINGS=$BUILD_DIR/android-$APK_TARGET-deployment-settings.json" >> $GITHUB_ENV + + + - name: Configure CMake + env: + CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}/lib/cmake + run: > + ${QT_ROOT_DIR}/bin/qt-cmake + -G Ninja + -B $BUILD_DIR + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR + ${{ matrix.additional_cmake_flags }} + -S ${{ github.workspace }}/MaterialTester + + - name: Build + run: cmake --build $BUILD_DIR ${{ matrix.additional_build_flags }} + + - name: Debug output + run: find ${{ github.workspace }} -type d -print | sed -e 's;[^/]*/;| ;g;s;| $;|-- ;' + + - name: Signing Android package with common key + env: + secret_test: ${{ secrets.KEYSTOREPASSWORD }} + if: matrix.qttarget == 'android' && env.secret_test != '' + run: | + echo ${{ secrets.SIGNINGKEYBASE64 }} > release.keystore.base64 + base64 -d release.keystore.base64 > release.keystore + $QT_HOST_PATH/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-34 --gradle --release --sign release.keystore alpinemaps --storepass ${{ secrets.KEYSTOREPASSWORD }} + + - name: Signing Android packages with generated key + env: + secret_test: ${{ secrets.KEYSTOREPASSWORD }} + if: matrix.qttarget == 'android' && env.secret_test == '' + run: | + keytool -genkey -v -keystore release.keystore -alias alpinemaps -keyalg RSA -sigalg SHA1withRSA -keysize 2048 -validity 10000 -keypass asdfasdf -storepass asdfasdf -dname "CN=Franz, OU=IT, O=Furz, L=Rattenberg, ST=Tirol, C=AT" + $QT_HOST_PATH/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-34 --gradle --release --sign release.keystore alpinemaps --storepass asdfasdf + + README_PATH=$APK_DIR/read_me.txt + echo "The apk was signed with a generated key which changes every time the apk is generated. This means, that android might refuse to install it if another apk with the same app was installed previously. You'll have to deinstall it. Doing so will delete all settings and cache." >> $README_PATH + echo "" >> $README_PATH + echo "In order to prevent that, you have to generate your own key or use our public key:" >> $README_PATH + echo "" >> $README_PATH + echo "To generate your own key:" >> $README_PATH + echo "- https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore. Use 'alpinemaps' as the alias!" >> $README_PATH + echo "- If you have the android dev setup ready in Qt Creator, you can also create the keystore via Projects (on the left side toolboar) -> Android Qt ... -> Build -> Build Steps -> Build Android APK -> Application Signature -> Create. Use 'alpinemaps' as the alias!" >> $README_PATH + echo "- Then you have to encode the keystore in base64, e.g., on linux via 'base64 keystorefile > keystorefile.base64'" >> $README_PATH + echo "- Finally, create the following secrets in github -> your repo -> Settings -> Secrets and variables -> Actions -> Repository secrets" >> $README_PATH + echo " SIGNINGKEYBASE64 = the base64 encoded key" >> $README_PATH + echo " KEYSTOREPASSWORD = the password used to create the keystore" >> $README_PATH + echo "" >> $README_PATH + echo "To use our public key, go to https://github.com/AlpineMapsOrg/renderer/blob/main/creating_apk_keys.md" >> $README_PATH + echo "" >> $README_PATH + echo "Oh, and I hope this saved your day :)" >> $README_PATH + + - name: Copy android packages + if: matrix.qttarget == 'android' + run: | + mkdir -p $INSTALL_DIR + cp -r $APK_DIR/* $INSTALL_DIR + + - name: Create artifact + uses: actions/upload-artifact@v4 + with: + name: files_${{ matrix.qtarch }} + path: ${{ github.workspace }}/install/ + if-no-files-found: error + + deploy: + if: github.event_name == 'push' + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: sudo apt-get install -y lftp + + - name: Clone repository (only for version number) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: ${{github.workspace}}/downloaded + + - name: Move into place + run: | + mkdir $GITHUB_WORKSPACE/github_page + mv $GITHUB_WORKSPACE/downloaded/*/* $GITHUB_WORKSPACE/github_page/ + + - name: Upload to an FTP host + env: + FTP_USER: ${{ secrets.FTP_USER }} + FTP_PASS: ${{ secrets.FTP_PASS }} + FTP_HOST: ${{ secrets.FTP_HOST }} + if: env.FTP_HOST != '' + run: | + reponame=$(echo $GITHUB_REPOSITORY | grep -oE "[^/]*$") + lftp -c " + set ftp:ssl-force true; + open -u $FTP_USER,$FTP_PASS $FTP_HOST; + mirror -R -e -v -n $GITHUB_WORKSPACE/github_page/. ./${reponame}_$(git describe --tags --dirty=-d --abbrev=1); + " + + - name: Generate Directory Listings + uses: jayanta525/github-pages-directory-listing@v4.0.0 + with: + FOLDER: github_page + + - name: Create Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{github.workspace}}/github_page + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..ff4e986 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,102 @@ +name: Linux tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: "linux" + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + compiler: [gcc12, clang15, clang17] + build_type: [Release] + include: + - compiler: gcc12 + CC: "/usr/bin/gcc-12" + CXX: "/usr/bin/g++-12" + - compiler: clang15 + CC: '/usr/bin/clang-15' + CXX: '/usr/bin/clang++-15' + - compiler: clang17 + CC: '/usr/bin/clang-17' + CXX: '/usr/bin/clang++-17' + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install Clang 17 + if: matrix.compiler == 'clang17' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x ./llvm.sh + sudo ./llvm.sh 17 + + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential ninja-build lld clang-15 libgl1-mesa-dev libxcb-cursor-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: 'linux' + target: 'desktop' + arch: 'linux_gcc_64' + dir: '${{github.workspace}}/qt' + install-deps: 'true' + + - name: Configure + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake + run: > + cmake -G Ninja + -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} + -DCMAKE_BUILD_TYPE=Debug + -B ./build + -S ./MaterialTester + + - name: Build + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + run: | + cmake --build ./build +# +# - name: Don't close loaded libraries for better sanitizer output +# env: +# CC: ${{ matrix.CC }} +# CXX: ${{ matrix.CXX }} +# run: | +# echo "#include " >> dlclose.c +# echo "int dlclose(void*) { return 0; }" >> dlclose.c +# $CC --shared dlclose.c -o libdlclose.so +# +# - name: Unittests on Linux +# env: +# QT_QPA_PLATFORM: offscreen +# DISPLAY: :1 +# LD_PRELOAD: ./libdlclose.so +# LSAN_OPTIONS: suppressions=./sanitizer_supressions/linux_leak.supp +# ASAN_OPTIONS: verify_asan_link_order=0 +# run: | +# ./build/alp_external/radix/unittests/unittests_radix +# ./build/unittests/nucleus/unittests_nucleus +# Xvfb :1 -screen 0 1024x768x16 & +# sleep 5 +# ./build/unittests/gl_engine/unittests_gl_engine +# ./build/app/alpineapp diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..6aa4710 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,73 @@ +name: Windows Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: "windows" + cancel-in-progress: true + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: 'powershell' + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install ninja-build tool (must be after Qt due PATH changes) + uses: turtlesec-no/get-ninja@main + + - name: Make sure MSVC is found when Ninja generator is in use + uses: ilammy/msvc-dev-cmd@v1 + + - name: Install 7zip + run: choco install 7zip.install + + - name: Install Mesa + shell: cmd + run: | + curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z + "C:\Program Files\7-Zip\7z.exe" x mesa.7z + mklink opengl32.dll "x64\opengl32.dll" + mklink libglapi.dll "x64\libglapi.dll" + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: '6.8.0' + host: windows + target: 'desktop' + arch: 'win64_msvc2022_64' + dir: '${{github.workspace}}/qt' + install-deps: 'true' + + - name: Configure + env: + CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake + run: > + cmake -G Ninja + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DALP_ENABLE_POSITIONING=false + -DALP_ENABLE_ASSERTS=ON + -B ./build + -S ./MaterialTester + + - name: Build + run: cmake --build ./build --config Debug + + # - name: Unittests on Windows + # env: + # MESA_GL_VERSION_OVERRIDE: 3.3 + # run: | + # ./build/alp_external/radix/unittests/unittests_radix.exe + # ./build/unittests/unittests_nucleus.exe + diff --git a/MMaterial/CMakeLists.txt b/MMaterial/CMakeLists.txt index cc1bdb9..8d97dcf 100644 --- a/MMaterial/CMakeLists.txt +++ b/MMaterial/CMakeLists.txt @@ -3,24 +3,8 @@ qt_add_library(MMaterialLib STATIC) set_target_properties(MMaterialLib PROPERTIES AUTOMOC ON) target_link_libraries(MMaterialLib PRIVATE Qt6::Quick) -# In order to update assets you need to: -# 1. check RefreshAssets in Build Steps -# 2. Rebuild project -# 3. Run cmake (you have to rerun it after build) - -add_custom_target(RefreshAssets - COMMAND ${CMAKE_COMMAND} -E env python refresh_assets.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Running the Python script to refresh assets" - VERBATIM -) - target_compile_definitions(MMaterialLib PRIVATE QT_QUICKCONTROLS_MATERIAL_STYLE) -# Read the contents of the file into a variable -file(READ "./cmake_data/svgPaths.txt" SVG_ASSETS) -file(READ "./cmake_data/pngPaths.txt" PNG_ASSETS) - list(APPEND MODULE_ASSETS # Fonts Fonts/Families/PublicSans/PublicSans-ExtraBold.ttf @@ -30,11 +14,7 @@ list(APPEND MODULE_ASSETS Fonts/Families/PublicSans/PublicSans-Regular.ttf Fonts/Families/PublicSans/PublicSans-Light.ttf Fonts/Families/PublicSans/PublicSans-ExtraLight.ttf - Icons/assets/icomoon.ttf - - ${PNG_ASSETS} - ${SVG_ASSETS} ) list(APPEND MODULE_QML_FILES @@ -206,3 +186,18 @@ qt_add_qml_module(MMaterialLib RESOURCES ${MODULE_ASSETS} SOURCES ${MODULE_SOURCES} ) + +# Read the contents of the file into a variable +file(GLOB PNG_ASSETS "Icons/assets/png/*.png") +file(GLOB JPEG_ASSETS "Icons/assets/png/*.jpeg") +file(GLOB SVG_ASSETS "Icons/assets/svg/*.svg") + +qt_add_resources(MMaterialLib + "mmaterial_icons" + BASE "${CMAKE_CURRENT_SOURCE_DIR}" + PREFIX "MMaterial" + FILES + ${PNG_ASSETS} + ${JPEG_ASSETS} + ${SVG_ASSETS} +) diff --git a/MMaterial/cmake_data/fontPaths.txt b/MMaterial/cmake_data/fontPaths.txt deleted file mode 100644 index f6bbfd2..0000000 --- a/MMaterial/cmake_data/fontPaths.txt +++ /dev/null @@ -1 +0,0 @@ -Fonts/Families\PublicSans\PublicSans-Black.ttf;Fonts/Families\PublicSans\PublicSans-BlackItalic.ttf;Fonts/Families\PublicSans\PublicSans-Bold.ttf;Fonts/Families\PublicSans\PublicSans-BoldItalic.ttf;Fonts/Families\PublicSans\PublicSans-ExtraBold.ttf;Fonts/Families\PublicSans\PublicSans-ExtraBoldItalic.ttf;Fonts/Families\PublicSans\PublicSans-ExtraLight.ttf;Fonts/Families\PublicSans\PublicSans-ExtraLightItalic.ttf;Fonts/Families\PublicSans\PublicSans-Italic.ttf;Fonts/Families\PublicSans\PublicSans-Light.ttf;Fonts/Families\PublicSans\PublicSans-LightItalic.ttf;Fonts/Families\PublicSans\PublicSans-Medium.ttf;Fonts/Families\PublicSans\PublicSans-MediumItalic.ttf;Fonts/Families\PublicSans\PublicSans-Regular.ttf;Fonts/Families\PublicSans\PublicSans-SemiBold.ttf;Fonts/Families\PublicSans\PublicSans-SemiBoldItalic.ttf;Fonts/Families\PublicSans\PublicSans-Thin.ttf;Fonts/Families\PublicSans\PublicSans-ThinItalic.ttf \ No newline at end of file diff --git a/MMaterial/cmake_data/pngPaths.txt b/MMaterial/cmake_data/pngPaths.txt deleted file mode 100644 index 873a9c8..0000000 --- a/MMaterial/cmake_data/pngPaths.txt +++ /dev/null @@ -1 +0,0 @@ -Icons/assets/png\abstract_futuristic_3D_shape_1.jpeg;Icons/assets/png\abstract_futuristic_3D_shape_2.jpeg;Icons/assets/png\abstract_futuristic_3D_shape_3.jpeg;Icons/assets/png\programmer-female.png;Icons/assets/png\programmer-female2.png;Icons/assets/png\programmer-male.png;Icons/assets/png\programmer-male2.png \ No newline at end of file diff --git a/MMaterial/cmake_data/svgPaths.txt b/MMaterial/cmake_data/svgPaths.txt deleted file mode 100644 index 40e83b5..0000000 --- a/MMaterial/cmake_data/svgPaths.txt +++ /dev/null @@ -1 +0,0 @@ -Icons/assets/svg\dashedCircle.svg;Icons/assets/svg\account_balance.svg;Icons/assets/svg\account_box.svg;Icons/assets/svg\account_circle.svg;Icons/assets/svg\adb.svg;Icons/assets/svg\add.svg;Icons/assets/svg\add_a_photo.svg;Icons/assets/svg\add_box.svg;Icons/assets/svg\add_business.svg;Icons/assets/svg\add_card.svg;Icons/assets/svg\add_circle.svg;Icons/assets/svg\add_photo_alternate.svg;Icons/assets/svg\add_shopping_cart.svg;Icons/assets/svg\air.svg;Icons/assets/svg\alarm.svg;Icons/assets/svg\analytics.svg;Icons/assets/svg\android.svg;Icons/assets/svg\apps.svg;Icons/assets/svg\arrow_back.svg;Icons/assets/svg\arrow_downward.svg;Icons/assets/svg\arrow_drop_down.svg;Icons/assets/svg\arrow_drop_up.svg;Icons/assets/svg\arrow_forward.svg;Icons/assets/svg\arrow_right.svg;Icons/assets/svg\atr.svg;Icons/assets/svg\attach_money.svg;Icons/assets/svg\autorenew.svg;Icons/assets/svg\backspace.svg;Icons/assets/svg\badge.svg;Icons/assets/svg\barcode_scanner.svg;Icons/assets/svg\bar_chart.svg;Icons/assets/svg\battery_charging_full.svg;Icons/assets/svg\battery_full.svg;Icons/assets/svg\battery_full_alt.svg;Icons/assets/svg\bluetooth.svg;Icons/assets/svg\bookmark.svg;Icons/assets/svg\brush.svg;Icons/assets/svg\build.svg;Icons/assets/svg\cable.svg;Icons/assets/svg\cake.svg;Icons/assets/svg\calculate.svg;Icons/assets/svg\calendar_month.svg;Icons/assets/svg\calendar_today.svg;Icons/assets/svg\call.svg;Icons/assets/svg\camera.svg;Icons/assets/svg\campaign.svg;Icons/assets/svg\cancel.svg;Icons/assets/svg\cast.svg;Icons/assets/svg\category.svg;Icons/assets/svg\celebration.svg;Icons/assets/svg\chat.svg;Icons/assets/svg\chat_bubble.svg;Icons/assets/svg\check.svg;Icons/assets/svg\check_box.svg;Icons/assets/svg\check_box_outline_blank.svg;Icons/assets/svg\check_circle.svg;Icons/assets/svg\chevron_left.svg;Icons/assets/svg\chevron_right.svg;Icons/assets/svg\circle.svg;Icons/assets/svg\close.svg;Icons/assets/svg\code.svg;Icons/assets/svg\computer.svg;Icons/assets/svg\construction.svg;Icons/assets/svg\contact_support.svg;Icons/assets/svg\content_copy.svg;Icons/assets/svg\credit_card.svg;Icons/assets/svg\crop_free.svg;Icons/assets/svg\currency_bitcoin.svg;Icons/assets/svg\dark_mode.svg;Icons/assets/svg\dashboard.svg;Icons/assets/svg\database.svg;Icons/assets/svg\delete.svg;Icons/assets/svg\delete_forever.svg;Icons/assets/svg\description.svg;Icons/assets/svg\devices.svg;Icons/assets/svg\directions_car.svg;Icons/assets/svg\domain.svg;Icons/assets/svg\done_all.svg;Icons/assets/svg\download.svg;Icons/assets/svg\download_for_offline.svg;Icons/assets/svg\draw.svg;Icons/assets/svg\eco.svg;Icons/assets/svg\edit.svg;Icons/assets/svg\edit_note.svg;Icons/assets/svg\electric_bolt.svg;Icons/assets/svg\emoji_objects.svg;Icons/assets/svg\engineering.svg;Icons/assets/svg\error.svg;Icons/assets/svg\euro.svg;Icons/assets/svg\event.svg;Icons/assets/svg\explore.svg;Icons/assets/svg\extension.svg;Icons/assets/svg\familiar_face_and_zone.svg;Icons/assets/svg\fast_forward.svg;Icons/assets/svg\fast_rewind.svg;Icons/assets/svg\favorite.svg;Icons/assets/svg\file_copy.svg;Icons/assets/svg\filter_alt.svg;Icons/assets/svg\filter_list.svg;Icons/assets/svg\finance.svg;Icons/assets/svg\fingerprint.svg;Icons/assets/svg\flag.svg;Icons/assets/svg\flashlight_on.svg;Icons/assets/svg\flash_on.svg;Icons/assets/svg\flight.svg;Icons/assets/svg\folder.svg;Icons/assets/svg\folder_open.svg;Icons/assets/svg\forum.svg;Icons/assets/svg\grid_on.svg;Icons/assets/svg\grid_view.svg;Icons/assets/svg\group.svg;Icons/assets/svg\groups.svg;Icons/assets/svg\group_add.svg;Icons/assets/svg\handyman.svg;Icons/assets/svg\headphones.svg;Icons/assets/svg\hearing.svg;Icons/assets/svg\help.svg;Icons/assets/svg\history.svg;Icons/assets/svg\home.svg;Icons/assets/svg\home_pin.svg;Icons/assets/svg\image.svg;Icons/assets/svg\imagesmode.svg;Icons/assets/svg\info.svg;Icons/assets/svg\inventory.svg;Icons/assets/svg\inventory_2.svg;Icons/assets/svg\keyboard_arrow_down.svg;Icons/assets/svg\keyboard_arrow_left.svg;Icons/assets/svg\keyboard_arrow_right.svg;Icons/assets/svg\keyboard_arrow_up.svg;Icons/assets/svg\label.svg;Icons/assets/svg\landscape.svg;Icons/assets/svg\language.svg;Icons/assets/svg\leaderboard.svg;Icons/assets/svg\lightbulb.svg;Icons/assets/svg\light_mode.svg;Icons/assets/svg\link.svg;Icons/assets/svg\list.svg;Icons/assets/svg\local_cafe.svg;Icons/assets/svg\local_mall.svg;Icons/assets/svg\location_on.svg;Icons/assets/svg\lock.svg;Icons/assets/svg\lock_open.svg;Icons/assets/svg\login.svg;Icons/assets/svg\logo.svg;Icons/assets/svg\logout.svg;Icons/assets/svg\loyalty.svg;Icons/assets/svg\mail.svg;Icons/assets/svg\manage_accounts.svg;Icons/assets/svg\map.svg;Icons/assets/svg\menu.svg;Icons/assets/svg\mic.svg;Icons/assets/svg\mode_comment.svg;Icons/assets/svg\monitoring.svg;Icons/assets/svg\more_horiz.svg;Icons/assets/svg\more_vert.svg;Icons/assets/svg\movie.svg;Icons/assets/svg\music_note.svg;Icons/assets/svg\my_location.svg;Icons/assets/svg\navigation.svg;Icons/assets/svg\near_me.svg;Icons/assets/svg\nest_eco_leaf.svg;Icons/assets/svg\nest_remote_comfort_sensor.svg;Icons/assets/svg\nightlight.svg;Icons/assets/svg\notifications.svg;Icons/assets/svg\open_in_new.svg;Icons/assets/svg\paid.svg;Icons/assets/svg\palette.svg;Icons/assets/svg\pause.svg;Icons/assets/svg\pause_circle.svg;Icons/assets/svg\person.svg;Icons/assets/svg\person_add.svg;Icons/assets/svg\person_pin.svg;Icons/assets/svg\pets.svg;Icons/assets/svg\phone_iphone.svg;Icons/assets/svg\photo_camera.svg;Icons/assets/svg\photo_library.svg;Icons/assets/svg\picture_as_pdf.svg;Icons/assets/svg\pin_drop.svg;Icons/assets/svg\play_arrow.svg;Icons/assets/svg\play_circle.svg;Icons/assets/svg\power.svg;Icons/assets/svg\print.svg;Icons/assets/svg\priority_high.svg;Icons/assets/svg\public.svg;Icons/assets/svg\qr_code.svg;Icons/assets/svg\qr_code_2.svg;Icons/assets/svg\qr_code_scanner.svg;Icons/assets/svg\query_stats.svg;Icons/assets/svg\question_mark.svg;Icons/assets/svg\radar.svg;Icons/assets/svg\refresh.svg;Icons/assets/svg\remove.svg;Icons/assets/svg\repeat.svg;Icons/assets/svg\replay.svg;Icons/assets/svg\report.svg;Icons/assets/svg\restart_alt.svg;Icons/assets/svg\restaurant.svg;Icons/assets/svg\restaurant_menu.svg;Icons/assets/svg\rocket_launch.svg;Icons/assets/svg\rss_feed.svg;Icons/assets/svg\save.svg;Icons/assets/svg\savings.svg;Icons/assets/svg\schedule.svg;Icons/assets/svg\school.svg;Icons/assets/svg\science.svg;Icons/assets/svg\search.svg;Icons/assets/svg\security.svg;Icons/assets/svg\sell.svg;Icons/assets/svg\send.svg;Icons/assets/svg\settings.svg;Icons/assets/svg\share.svg;Icons/assets/svg\shopping_bag.svg;Icons/assets/svg\shopping_cart.svg;Icons/assets/svg\shuffle.svg;Icons/assets/svg\signal_cellular_alt.svg;Icons/assets/svg\skip_next.svg;Icons/assets/svg\skip_previous.svg;Icons/assets/svg\smartphone.svg;Icons/assets/svg\sort.svg;Icons/assets/svg\sports_esports.svg;Icons/assets/svg\sports_soccer.svg;Icons/assets/svg\stadia_controller.svg;Icons/assets/svg\star.svg;Icons/assets/svg\stop.svg;Icons/assets/svg\stop_circle.svg;Icons/assets/svg\storage.svg;Icons/assets/svg\store.svg;Icons/assets/svg\storefront.svg;Icons/assets/svg\subscriptions.svg;Icons/assets/svg\sync.svg;Icons/assets/svg\task_alt.svg;Icons/assets/svg\theaters.svg;Icons/assets/svg\thumb_up.svg;Icons/assets/svg\timeline.svg;Icons/assets/svg\timer.svg;Icons/assets/svg\touch_app.svg;Icons/assets/svg\trending_down.svg;Icons/assets/svg\trending_up.svg;Icons/assets/svg\tune.svg;Icons/assets/svg\undo.svg;Icons/assets/svg\update.svg;Icons/assets/svg\upload_file.svg;Icons/assets/svg\usb.svg;Icons/assets/svg\verified.svg;Icons/assets/svg\verified_user.svg;Icons/assets/svg\videocam.svg;Icons/assets/svg\video_library.svg;Icons/assets/svg\visibility.svg;Icons/assets/svg\visibility_off.svg;Icons/assets/svg\volume_off.svg;Icons/assets/svg\volume_up.svg;Icons/assets/svg\wallet.svg;Icons/assets/svg\wallpaper.svg;Icons/assets/svg\warning.svg;Icons/assets/svg\wb_sunny.svg;Icons/assets/svg\where_to_vote.svg;Icons/assets/svg\widgets.svg;Icons/assets/svg\wifi.svg;Icons/assets/svg\wifi_off.svg;Icons/assets/svg\work.svg \ No newline at end of file diff --git a/MMaterial/refresh_assets.py b/MMaterial/refresh_assets.py deleted file mode 100644 index f9e7631..0000000 --- a/MMaterial/refresh_assets.py +++ /dev/null @@ -1,34 +0,0 @@ -import os - -def write_filenames_to_file(directory_path, output_txt_file_name): - try: - # List to store all file paths - all_files = [] - - # Traverse the directory tree - for root, dirs, files in os.walk(directory_path): - for file in files: - # Add the full path of the file to the list - full_path = os.path.join(root, file) - all_files.append(full_path) - - # Join the filenames with ";" - file_contents = ";".join(all_files) - - # Ensure the output directory exists - output_dir = os.path.dirname(output_txt_file_name) - if output_dir and not os.path.exists(output_dir): - os.makedirs(output_dir) - - # Write to the output file - with open(output_txt_file_name, 'w') as output_file: - output_file.write(file_contents) - - print(f"Successfully written filenames to {output_txt_file_name}") - - except Exception as e: - print(f"An error occurred: {e}") - -write_filenames_to_file("Icons/assets/svg", "./cmake_data/svgPaths.txt") -write_filenames_to_file("Icons/assets/png", "./cmake_data/pngPaths.txt") -write_filenames_to_file("Fonts/Families", "./cmake_data/fontPaths.txt") \ No newline at end of file diff --git a/MaterialTester/CMakeLists.txt b/MaterialTester/CMakeLists.txt index b17c1d7..336629d 100644 --- a/MaterialTester/CMakeLists.txt +++ b/MaterialTester/CMakeLists.txt @@ -105,10 +105,30 @@ set_target_properties(appMaterialTester PROPERTIES WIN32_EXECUTABLE TRUE ) -install(TARGETS appMaterialTester - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - +if (EMSCRIPTEN) + + set(MM_INSTALL_FILES + "$/appMaterialTester.js" + "$/appMaterialTester.wasm" + "$/appMaterialTester.html" + "$/qtloader.js" + ) + + # if (MM_ENABLE_THREADING) + # list(APPEND ALP_INSTALL_FILES "$/alpineapp.worker.js") + # endif() + install(FILES ${MM_INSTALL_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}) +else() + install(TARGETS appMaterialTester + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + + install(TARGETS appMaterialTester + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif() diff --git a/MaterialTester/main.cpp b/MaterialTester/main.cpp index 30660a3..beae408 100644 --- a/MaterialTester/main.cpp +++ b/MaterialTester/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -15,7 +16,16 @@ int main(int argc, char *argv[]) qputenv("MAIN_QML","../../../MaterialTester/Main.qml"); #endif QGuiApplication app(argc, argv); - + // // output qrc files: + // { + // qDebug() << "qrc files:"; + // QDirIterator it(":", QDirIterator::Subdirectories); + // while (it.hasNext()) { + // const auto path = it.next(); + // const auto file = QFile(path); + // qDebug() << path << " size: " << file.size() / 1024 << "kb"; + // } + // } CustomEngine engine; Clipboard clipboard;