From 3b3b1d0d4c1d76243d6f32fa35d9845b4a3a76fa Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 15 Dec 2015 15:03:42 +0100 Subject: [PATCH] Fixed: Allow to sign OS X bundles with APPLE_CERTIFICATE --HG-- branch : develop --- code/ryzom/client/src/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 2a5b1c175..29ec33d09 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -74,6 +74,31 @@ IF(APPLE) IF(RYZOM_DATA_DIR) 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() + 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() + + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/installscript_osx.vdf ${RYZOM_OUTPUT_DIR}) ENDIF() INCLUDE_DIRECTORIES(