123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- @ECHO off
- REM Copyright (c) Contributors to the Open 3D Engine Project.
- REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
- REM
- REM SPDX-License-Identifier: Apache-2.0 OR MIT
- setlocal enabledelayedexpansion
- :: TAB equals 4 spaces
- set TAB=
- :: Directory in which this batch file lives
- set CURRENT_DIRECTORY=%~dp0
- :: Destination file we're writing too
- set OUTPUT_FILE=atomsampleviewer_asset_files.cmake
- :: Write copyright header to top of file
- echo # > %OUTPUT_FILE%
- echo # Copyright (c) Contributors to the Open 3D Engine Project. >> %OUTPUT_FILE%
- echo # For complete copyright and license terms please see the LICENSE at the root of this distribution. >> %OUTPUT_FILE%
- echo # >> %OUTPUT_FILE%
- echo # SPDX-License-Identifier: Apache-2.0 OR MIT >> %OUTPUT_FILE%
- echo # >> %OUTPUT_FILE%
- echo.>> %OUTPUT_FILE%
- :: .cmake file first line should be "set(FILES"
- echo set(FILES>> %OUTPUT_FILE%
- :: Here we append the list of files
- (
- :: Recursive for loop for every file in directory and subdirectories
- for /R %%f in (*.*) do (
-
- :: Get full file path and name
- set filePath=%%f
-
- :: Remove the current directory from the file path. This gives us the local path
- set relativeFilePath=!filePath:%CURRENT_DIRECTORY%=!
- :: Turns "\my\asset\folder" into "/my/asset/folder" for cmake
- set relativeFilePath=!relativeFilePath:\=/!
-
-
- :: Filter out files in Materials/HotReloadTest. materialHotReloadPath is the first 23 characters of the relative file path
- set materialHotReloadPath=!relativeFilePath:~0,23!
- if not !materialHotReloadPath! == Materials/HotReloadTest (
- :: Filter out files in Cache/. cachePath is the first 6 characters of the relative file path
- set cachePath=!relativeFilePath:~0,6!
- if not !cachePath! == Cache/ (
- :: Filter only relevant file types
- if !relativeFilePath:~-4! == .lua echo %TAB%!relativeFilePath!
- if !relativeFilePath:~-5! == .pass echo %TAB%!relativeFilePath!
- if !relativeFilePath:~-5! == .azsl echo %TAB%!relativeFilePath!
- if !relativeFilePath:~-6! == .azsli echo %TAB%!relativeFilePath!
- if !relativeFilePath:~-7! == .shader echo %TAB%!relativeFilePath!
- if !relativeFilePath:~-13! == .materialtype echo %TAB%!relativeFilePath!
-
- )
- )
- )
- ) >> %OUTPUT_FILE%
- @echo ) >> %OUTPUT_FILE%
|