Skip to content

Commit

Permalink
Fix build error on macOS when copying resources to bundle in standalo…
Browse files Browse the repository at this point in the history
…ne SDK build.
  • Loading branch information
adamjs committed Dec 16, 2020
1 parent ce24902 commit adcae14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions samples/Sample 7 - OpenGL Integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ endif ()
# Copy assets to assets path
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/assets/" "${ASSETS_PATH}")

if (APPLE)
# Copy resources to resources directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}/resources/" "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/resources")

# Resources directory is also copied to target directory in the "Copy all binaries" step.
# Remove this duplicate directory.
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "$<TARGET_FILE_DIR:${APP_NAME}>/resources")
endif ()
2 changes: 1 addition & 1 deletion samples/Sample 8 - Web Browser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_custom_command(TARGET ${APP_NAME} POST_BUILD
if (APPLE)
# Copy resources to resources directory
add_custom_command(TARGET ${APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${WEBCORE_DIR}/bin/resources/" "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/resources")
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ULTRALIGHT_BINARY_DIR}/resources/" "$<TARGET_FILE_DIR:${APP_NAME}>/../Resources/resources")

# Resources directory is also copied to target directory in the "Copy all binaries" step.
# Remove this duplicate directory.
Expand Down

0 comments on commit adcae14

Please sign in to comment.