# HG changeset patch # User Patric Stout # Date 2024-01-30 23:33:21 # Node ID 364bdb14afa0652554a4064c3df9b62cef7229eb # Parent c60c0a3706e12bb73ae2ae32fa515b1536b51763 Fix #9655: [Emscripten] install the correct files on install (#11934) Co-authored-by: Stepan Dyatkovskiy (kaomoneus) diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake --- a/cmake/InstallAndPackage.cmake +++ b/cmake/InstallAndPackage.cmake @@ -23,16 +23,28 @@ install(TARGETS openttd COMPONENT Runtime ) -install(DIRECTORY - ${CMAKE_BINARY_DIR}/lang - ${CMAKE_BINARY_DIR}/baseset - ${CMAKE_BINARY_DIR}/ai - ${CMAKE_BINARY_DIR}/game - ${CMAKE_SOURCE_DIR}/bin/scripts - DESTINATION ${DATA_DESTINATION_DIR} - COMPONENT language_files - REGEX "ai/[^\.]+$" EXCLUDE # Ignore subdirs in ai dir -) +if (NOT EMSCRIPTEN) + # Emscripten embeds these files in openttd.data. + # See CMakeLists.txt in the root. + install(DIRECTORY + ${CMAKE_BINARY_DIR}/lang + ${CMAKE_BINARY_DIR}/baseset + ${CMAKE_BINARY_DIR}/ai + ${CMAKE_BINARY_DIR}/game + ${CMAKE_SOURCE_DIR}/bin/scripts + DESTINATION ${DATA_DESTINATION_DIR} + COMPONENT language_files + REGEX "ai/[^\.]+$" EXCLUDE # Ignore subdirs in ai dir + ) +else() + install(FILES + ${CMAKE_BINARY_DIR}/openttd.js + ${CMAKE_BINARY_DIR}/openttd.wasm + ${CMAKE_BINARY_DIR}/openttd.data + DESTINATION ${BINARY_DESTINATION_DIR} + COMPONENT Runtime + ) +endif() install(FILES ${CMAKE_SOURCE_DIR}/COPYING.md @@ -79,7 +91,7 @@ if(OPTION_INSTALL_FHS) COMPONENT manual) endif() -if(UNIX AND NOT APPLE) +if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN) install(DIRECTORY ${CMAKE_BINARY_DIR}/media/icons ${CMAKE_BINARY_DIR}/media/pixmaps