Fixed: Sign OS X binaries needed by client and copy them in Ryzom bundle

This commit is contained in:
kervala 2016-01-03 17:47:31 +01:00
parent 5c8c15ab21
commit b7f323b3fb
5 changed files with 48 additions and 21 deletions

View file

@ -140,6 +140,28 @@ IF(WITH_SSE2)
ENDIF(WITH_SSE3)
ENDIF(WITH_SSE2)
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
# Xcode 7.0 and later versions
SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# Xcode 6.4 and previous versions
SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# System path
SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
SET(CODESIGN_ALLOCATE)
ENDIF()
ENDIF()
MACRO(ADD_QT_LIBRARY _NAME)
IF(WIN32)
SET(_PREFIX "Qt5")

View file

@ -48,3 +48,11 @@ NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report")
NL_ADD_RUNTIME_FLAGS(crash_report)
INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX})
IF(WITH_RYZOM_CLIENT AND APPLE)
IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
ADD_CUSTOM_COMMAND(TARGET crash_report POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crash_report" COMMENT "Signing crash_report executable...")
ENDIF()
ADD_CUSTOM_COMMAND(TARGET crash_report POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crash_report ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app/Contents/MacOS/CrashReport)
ENDIF()

View file

@ -78,29 +78,10 @@ IF(WITH_RYZOM_CLIENT)
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -RpX ${RYZOM_DATA_DIR} ${RYZOM_RESOURCES_DIR})
ENDIF()
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
# Xcode 7.0 and later versions
SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# Xcode 6.4 and previous versions
SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# System path
SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
ELSE()
IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing bundle...")
ENDIF()
ENDIF()
ENDIF()
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}

View file

@ -69,3 +69,11 @@ IF(WITH_PCH)
ENDIF()
INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client)
IF(WITH_RYZOM_CLIENT AND APPLE)
IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
ADD_CUSTOM_COMMAND(TARGET ryzom_configuration_qt POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_configuration_qt" COMMENT "Signing ryzom_configuration_qt executable...")
ENDIF()
ADD_CUSTOM_COMMAND(TARGET ryzom_configuration_qt POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_configuration_qt ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app/Contents/MacOS/RyzomConfiguration)
ENDIF()

View file

@ -43,3 +43,11 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
INSTALL(TARGETS ryzom_client_patcher RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)
IF(WITH_RYZOM_CLIENT AND APPLE)
IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
ADD_CUSTOM_COMMAND(TARGET ryzom_client_patcher POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_client_patcher" COMMENT "Signing ryzom_client_patcher executable...")
ENDIF()
ADD_CUSTOM_COMMAND(TARGET ryzom_client_patcher POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_client_patcher ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app/Contents/MacOS/RyzomClientPatcher)
ENDIF()