Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
this commit fixes the copying of dependencies into the app sandbox
  • Loading branch information
marauder2k7 committed Aug 3, 2024
1 parent 95c7e9f commit d62b40a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Engine/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ if (APPLE)
MACOSX_BUNDLE_INFO_PLIST "${TORQUE_APP_ROOT_DIRECTORY}/source/Info.plist"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.torque3d.${TORQUE_APP_NAME}"
XCODE_ATTRIBUTE_INSTALL_PATH "/Applications"
INSTALL_RPATH "@executable_path/../Frameworks"
XCODE_ATTRIBUTE_SKIP_INSTALL "No"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_LINKER_DISPLAYS_MANGLED_NAMES[variant=Debug] YES
Expand Down Expand Up @@ -497,7 +498,9 @@ append_defs()
foreach (LIBRARY_BINARY ${TORQUE_ADDITIONAL_LIBRARY_BINARIES})
if (APPLE)
# For OSX, we want these binaries to be copied to the Frameworks directory
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_BINARY} "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$(CONFIGURATION)")
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_BINARY} "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$(CONFIGURATION)")
else()
# All other platforms expect the file next to the executable
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_BINARY} "${TORQUE_APP_GAME_DIRECTORY}")
Expand All @@ -517,9 +520,9 @@ if (UNIX)
# Only pay attention to shared libraries and make them output to the app resources
if ("${LINK_LIBRARY_TYPE}" STREQUAL "SHARED_LIBRARY")
if (APPLE)
set_target_properties(${GAME_LINK_LIBRARY} PROPERTIES
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
XCODE_ATTRIBUTE_SKIP_INSTALL[variant=Release] YES)
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${GAME_LINK_LIBRARY}>" "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$<TARGET_FILE_NAME:${GAME_LINK_LIBRARY}>")
else()
set_target_properties(${GAME_LINK_LIBRARY} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TORQUE_APP_GAME_DIRECTORY}")
endif(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion Tools/CMake/torqueMacOSconfigs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")

# Debug configuration for quicker debug builds
set(CMAKE_XCODE_ATTRIBUTE_LINKER_DISPLAYS_MANGLED_NAMES[variant=Debug] YES)
Expand Down

0 comments on commit d62b40a

Please sign in to comment.