Skip to content

Commit

Permalink
Merge pull request #1562 from Binary-Vanguard-12138/android_build_assets
Browse files Browse the repository at this point in the history
Added missing resources to assets in Android build
  • Loading branch information
mcallegari committed May 2, 2024
2 parents 3150b44 + 9466d92 commit 0ba8c2b
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 11 deletions.
1 change: 1 addition & 0 deletions platforms/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets
13 changes: 12 additions & 1 deletion resources/colorfilters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,15 @@ project(colorfilters)

file(GLOB COLOR_FILTER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qxcf")

install(FILES ${COLOR_FILTER_FILES} DESTINATION ${INSTALLROOT}/${COLORFILTERSDIR})
if(ANDROID)
set(COLOR_FILTERS_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${COLORFILTERSDIR}")
# Create the assets directory if it doesn't exist
file(MAKE_DIRECTORY ${COLOR_FILTERS_ASSETS_DIR})

# Copy the color filter files to the assets directory
foreach(COLOR_FILTER_FILE ${COLOR_FILTER_FILES})
file(COPY ${COLOR_FILTER_FILE} DESTINATION ${COLOR_FILTERS_ASSETS_DIR})
endforeach()
endif()

install(FILES ${COLOR_FILTER_FILES} DESTINATION ${INSTALLROOT}/${COLORFILTERSDIR})
27 changes: 24 additions & 3 deletions resources/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
project(docs)

file(GLOB HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/html_en_EN/*.html")
install(FILES ${HTML_FILES} DESTINATION ${INSTALLROOT}/${DOCSDIR}/html)

file(GLOB IMAGE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/images/*.png")
install(FILES ${IMAGE_FILES} DESTINATION ${INSTALLROOT}/${DOCSDIR}/images)

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directories for the HTML and image files within the Android package
set(HTML_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${DOCSDIR}/html")
set(IMAGES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${DOCSDIR}/images")

# Create the assets directories if they don't exist
file(MAKE_DIRECTORY ${HTML_ASSETS_DIR})
file(MAKE_DIRECTORY ${IMAGES_ASSETS_DIR})

# Copy the HTML files to the assets directory
foreach(HTML_FILE IN LISTS HTML_FILES)
file(COPY ${HTML_FILE} DESTINATION ${HTML_ASSETS_DIR})
endforeach()

# Copy the image files to the assets directory
foreach(IMAGE_FILE IN LISTS IMAGE_FILES)
file(COPY ${IMAGE_FILE} DESTINATION ${IMAGES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${HTML_FILES} DESTINATION ${INSTALLROOT}/${DOCSDIR}/html)
install(FILES ${IMAGE_FILES} DESTINATION ${INSTALLROOT}/${DOCSDIR}/images)
34 changes: 28 additions & 6 deletions resources/fixtures/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
project(fixtures)

# Install FixturesMap.xml and all subdirectories (except ./scripts and .)
file(GLOB FILES_AND_DIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
list(FILTER FILES_AND_DIRECTORIES EXCLUDE REGEX "^scripts$")
list(REMOVE_ITEM FILES_AND_DIRECTORIES ".")
file(GLOB FIXTURES_FILES_AND_DIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
list(FILTER FIXTURES_FILES_AND_DIRECTORIES EXCLUDE REGEX "^scripts$")
list(REMOVE_ITEM FIXTURES_FILES_AND_DIRECTORIES ".")

foreach(FILE_AND_DIRECTORY ${FILES_AND_DIRECTORIES})
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_AND_DIRECTORY}")
install(DIRECTORY ${FILE_AND_DIRECTORY} DESTINATION ${INSTALLROOT}/${FIXTUREDIR})
# Only perform the copy if we're building for Android
if(ANDROID)
# Loop through each file and directory and copy them to the assets directory, excluding the scripts directory
foreach(FIXTURE_FILE_AND_DIRECTORY ${FIXTURES_FILES_AND_DIRECTORIES})
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FIXTURE_FILE_AND_DIRECTORY}")
# Calculate the full path to the source directory
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${FIXTURE_FILE_AND_DIRECTORY}")

# Calculate the full path to the destination directory within the Android package
set(DESTINATION_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${FIXTUREDIR}")

# Copy the directory to the assets directory
file(COPY ${SOURCE_DIR} DESTINATION ${DESTINATION_DIR})
endif()
endforeach()

# Copy the FixturesMap.xml file to the assets directory
set(SOURCE_FIXTURES_MAP "${CMAKE_CURRENT_SOURCE_DIR}/FixturesMap.xml")
set(DESTINATION_FIXTURES_MAP "${ANDROID_PACKAGE_SOURCE_DIR}/${FIXTUREDIR}")
file(COPY ${SOURCE_FIXTURES_MAP} DESTINATION ${DESTINATION_FIXTURES_MAP})
endif()

foreach(FIXTURE_FILE_AND_DIRECTORY ${FIXTURES_FILES_AND_DIRECTORIES})
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FIXTURE_FILE_AND_DIRECTORY}")
install(DIRECTORY ${FIXTURE_FILE_AND_DIRECTORY} DESTINATION ${INSTALLROOT}/${FIXTUREDIR})
endif()
endforeach()

Expand Down
18 changes: 18 additions & 0 deletions resources/gobos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@ project(gobo)

set(GOBO_FILES Chauvet ClayPaky GLP Others Robe SGM SGM-Color)

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the gobo files within the Android package
set(GOBO_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${GOBODIR}")

# Loop through each directory and copy it to the assets directory
foreach(GOBO_DIR IN LISTS GOBO_FILES)
# Calculate the full path to the source gobo directory
set(SOURCE_GOBOS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${GOBO_DIR}")

# Calculate the full path to the destination gobo directory
set(DESTINATION_GOBOS_DIR "${GOBO_ASSETS_DIR}")

# Copy the gobo directory to the assets directory
file(COPY ${SOURCE_GOBOS_DIR} DESTINATION ${DESTINATION_GOBOS_DIR})
endforeach()
endif()

install(DIRECTORY ${GOBO_FILES} DESTINATION ${INSTALLROOT}/${GOBODIR})
14 changes: 14 additions & 0 deletions resources/inputprofiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(profiles)

file(GLOB PROFILE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qxi")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the profile files within the Android package
set(PROFILES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${INPUTPROFILEDIR}")

# Create the profiles assets directory if it doesn't exist
file(MAKE_DIRECTORY ${PROFILES_ASSETS_DIR})

# Copy the profile .qxi files to the assets directory
foreach(PROFILE_FILE IN LISTS PROFILE_FILES)
file(COPY ${PROFILE_FILE} DESTINATION ${PROFILES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${PROFILE_FILES} DESTINATION ${INSTALLROOT}/${INPUTPROFILEDIR})
14 changes: 14 additions & 0 deletions resources/meshes/fixtures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(fixture_meshes)

file(GLOB FIXTURE_MESH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.dae")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the fixture mesh files within the Android package
set(FIXTURE_MESHES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${MESHESDIR}/fixtures")

# Create the fixture meshes assets directory if it doesn't exist
file(MAKE_DIRECTORY ${FIXTURE_MESHES_ASSETS_DIR})

# Copy the fixture mesh .dae files to the assets directory
foreach(FIXTURE_MESH_FILE IN LISTS FIXTURE_MESH_FILES)
file(COPY ${FIXTURE_MESH_FILE} DESTINATION ${FIXTURE_MESHES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${FIXTURE_MESH_FILES} DESTINATION ${INSTALLROOT}/${MESHESDIR}/fixtures)
14 changes: 14 additions & 0 deletions resources/meshes/generic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(generic_meshes)

file(GLOB GENERIC_MESH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.obj")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the generic mesh files within the Android package
set(GENERIC_MESHES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${MESHESDIR}/generic")

# Create the generic meshes assets directory if it doesn't exist
file(MAKE_DIRECTORY ${GENERIC_MESHES_ASSETS_DIR})

# Copy the generic mesh .obj files to the assets directory
foreach(GENERIC_MESH_FILE IN LISTS GENERIC_MESH_FILES)
file(COPY ${GENERIC_MESH_FILE} DESTINATION ${GENERIC_MESHES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${GENERIC_MESH_FILES} DESTINATION ${INSTALLROOT}/${MESHESDIR}/generic)
14 changes: 14 additions & 0 deletions resources/meshes/stage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(stage_meshes)

file(GLOB STAGE_MESH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.obj")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the stage mesh files within the Android package
set(STAGE_MESHES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${MESHESDIR}/stage")

# Create the stage meshes assets directory if it doesn't exist
file(MAKE_DIRECTORY ${STAGE_MESHES_ASSETS_DIR})

# Copy the stage mesh .obj files to the assets directory
foreach(STAGE_MESH_FILE IN LISTS STAGE_MESH_FILES)
file(COPY ${STAGE_MESH_FILE} DESTINATION ${STAGE_MESHES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${STAGE_MESH_FILES} DESTINATION ${INSTALLROOT}/${MESHESDIR}/stage)
14 changes: 14 additions & 0 deletions resources/miditemplates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(miditemplates)

file(GLOB MIDITEMPLATE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qxm")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the miditemplate files within the Android package
set(MIDITEMPLATES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${MIDITEMPLATEDIR}")

# Create the miditemplates assets directory if it doesn't exist
file(MAKE_DIRECTORY ${MIDITEMPLATES_ASSETS_DIR})

# Copy the miditemplate .qxm files to the assets directory
foreach(MIDITEMPLATE_FILE IN LISTS MIDITEMPLATE_FILES)
file(COPY ${MIDITEMPLATE_FILE} DESTINATION ${MIDITEMPLATES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${MIDITEMPLATE_FILES} DESTINATION ${INSTALLROOT}/${MIDITEMPLATEDIR})
14 changes: 14 additions & 0 deletions resources/modifierstemplates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(modtemplates)

file(GLOB MODTEMPLATE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qxmt")

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the modtemplate files within the Android package
set(MODTEMPLATES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${MODIFIERSTEMPLATEDIR}")

# Create the modtemplates assets directory if it doesn't exist
file(MAKE_DIRECTORY ${MODTEMPLATES_ASSETS_DIR})

# Copy the modtemplate .qxmt files to the assets directory
foreach(MODTEMPLATE_FILE IN LISTS MODTEMPLATE_FILES)
file(COPY ${MODTEMPLATE_FILE} DESTINATION ${MODTEMPLATES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${MODTEMPLATE_FILES} DESTINATION ${INSTALLROOT}/${MODIFIERSTEMPLATEDIR})
14 changes: 14 additions & 0 deletions resources/rgbscripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@ set(SCRIPT_FILES
waves.js
)

# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the script files within the Android package
set(SCRIPTS_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${INSTALLROOT}/${RGBSCRIPTDIR}")

# Create the scripts assets directory if it doesn't exist
file(MAKE_DIRECTORY ${SCRIPTS_ASSETS_DIR})

# Copy the script files to the assets directory
foreach(SCRIPT_FILE IN LISTS SCRIPT_FILES)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE} DESTINATION ${SCRIPTS_ASSETS_DIR})
endforeach()
endif()

install(FILES ${SCRIPT_FILES} DESTINATION ${INSTALLROOT}/${RGBSCRIPTDIR})
16 changes: 15 additions & 1 deletion resources/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ project(samples)

file(GLOB SAMPLE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qxw")

install(FILES ${SAMPLE_FILES} DESTINATION ${SAMPLESDIR})
# Only perform the copy if we're building for Android
if(ANDROID)
# Define the destination directory for the sample files within the Android package
set(SAMPLES_ASSETS_DIR "${ANDROID_PACKAGE_SOURCE_DIR}/${SAMPLESDIR}")

# Create the samples assets directory if it doesn't exist
file(MAKE_DIRECTORY ${SAMPLES_ASSETS_DIR})

# Copy the sample .qxw files to the assets directory
foreach(SAMPLE_FILE ${SAMPLE_FILES})
file(COPY ${SAMPLE_FILE} DESTINATION ${SAMPLES_ASSETS_DIR})
endforeach()
endif()

install(FILES ${SAMPLE_FILES} DESTINATION ${SAMPLESDIR})

0 comments on commit 0ba8c2b

Please sign in to comment.