Meta: Copy resources to the app bundle during create_ladybird_bundle()

For some reason, moving the UI-specific CMake to its own files prevents
resource files from being copied to the Resource directory in the macOS
application. I'm not sure what the difference here is, but doing this
step during create_ladybird_bundle() works.
This commit is contained in:
Timothy Flynn 2024-06-05 15:04:21 -04:00 committed by Andrew Kaster
parent c79041344d
commit 8641e78cdc
Notes: sideshowbarker 2024-07-17 10:39:39 +09:00

View file

@ -1,3 +1,4 @@
include(cmake/ResourceFiles.cmake)
set(LADYBIRD_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/HelperProcess.cpp
@ -34,6 +35,14 @@ function(create_ladybird_bundle target_name)
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "${bundle_dir}/Contents/lib"
)
endif()
if (APPLE)
set(resource_base_dir "$<TARGET_BUNDLE_DIR:${target_name}>/Contents/Resources")
else()
set(resource_base_dir "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_DATADIR}/Lagom")
endif()
copy_resources_to_build(${resource_base_dir} ${target_name})
endfunction()
# Select UI Framework
@ -121,13 +130,6 @@ if (APPLE)
set_helper_process_properties(headless-browser WebDriver)
endif()
include(cmake/ResourceFiles.cmake)
set(resource_base_dir "${CMAKE_BINARY_DIR}/${IN_BUILD_PREFIX}${CMAKE_INSTALL_DATADIR}/Lagom")
if (APPLE)
set(resource_base_dir "$<TARGET_BUNDLE_DIR:ladybird>/Contents/Resources")
endif()
copy_resources_to_build(${resource_base_dir} ladybird)
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/InstallRules.cmake)
endif()