2015-11-25 13:42:49 +00:00
|
|
|
set(app "${CMAKE_INSTALL_PREFIX}/@EXE@")
|
2015-11-26 08:54:45 +00:00
|
|
|
set(weprocess "${app}/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
|
2015-10-13 09:05:27 +00:00
|
|
|
|
|
|
|
set(args ${app})
|
|
|
|
list(APPEND args "-verbose=2")
|
|
|
|
list(APPEND args "-qmldir=@SOURCE_ROOT@/src/ui")
|
|
|
|
foreach(BIN ${BINS})
|
|
|
|
list(APPEND args "-executable=${app}/${BIN}")
|
|
|
|
endforeach(BIN ${BINS})
|
|
|
|
|
2015-11-25 13:42:49 +00:00
|
|
|
set(ENV{DYLD_LIBRARY_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
|
|
|
|
set(ENV{DYLD_FRAMEWORK_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
|
|
|
|
|
2015-10-13 09:05:27 +00:00
|
|
|
execute_process(
|
2016-06-22 07:45:28 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove "${app}/Contents/Resources/qt.conf"
|
2021-04-14 02:59:42 +00:00
|
|
|
COMMAND "@QTROOT@/bin/macdeployqt" ${args}
|
2016-06-22 07:45:28 +00:00
|
|
|
WORKING_DIRECTORY "@QTROOT@/bin"
|
2015-10-13 09:05:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
#set(ENTITLEMENTS --entitlements @SOURCE_ROOT@/bundle/osx/Konvergo.entitlements)
|
2021-04-04 06:48:27 +00:00
|
|
|
#set(CODESIGN codesign ${ENTITLEMENTS} --force --sign "Developer ID Application: Plex Inc.")
|
2015-10-13 09:05:27 +00:00
|
|
|
|
|
|
|
macro(sign_binary BIN)
|
|
|
|
message(STATUS "Signing: ${BIN}")
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${CODESIGN} "${BIN}"
|
|
|
|
RESULT_VARIABLE result
|
|
|
|
)
|
|
|
|
if(NOT ${result} EQUAL 0)
|
|
|
|
message(FATAL_ERROR "Failed to sign ${BIN}")
|
|
|
|
endif(NOT ${result} EQUAL 0)
|
|
|
|
endmacro(sign_binary BIN)
|
|
|
|
|
|
|
|
if(@DO_SIGN@)
|
2015-11-26 13:51:44 +00:00
|
|
|
sign_binary(${weprocess})
|
2015-10-13 09:05:27 +00:00
|
|
|
file(GLOB_RECURSE LIBS
|
|
|
|
FOLLOW_SYMLINKS
|
2015-11-25 14:18:09 +00:00
|
|
|
"${app}/*.dylib"
|
2015-10-13 09:05:27 +00:00
|
|
|
)
|
2015-11-25 14:18:09 +00:00
|
|
|
file(GLOB FRAMEWORKS FOLLOW_SYMLINKS LIST_DIRECTORIES true "${app}/Contents/Frameworks/*")
|
2015-10-13 09:05:27 +00:00
|
|
|
foreach(LIB ${LIBS} ${FRAMEWORKS})
|
|
|
|
sign_binary(${LIB})
|
|
|
|
endforeach(LIB ${LIBS})
|
|
|
|
|
|
|
|
foreach(BIN ${BINS})
|
2015-11-25 14:18:09 +00:00
|
|
|
sign_binary(${app}/${BIN})
|
2015-10-13 09:05:27 +00:00
|
|
|
endforeach(BIN ${BINS})
|
|
|
|
|
2015-11-25 14:18:09 +00:00
|
|
|
sign_binary(${app})
|
2015-10-13 09:05:27 +00:00
|
|
|
|
|
|
|
message("Verifing signature")
|
|
|
|
execute_process(
|
|
|
|
COMMAND codesign --verbose=4 --verify "${CMAKE_INSTALL_PREFIX}/@EXE@"
|
|
|
|
RESULT_VARIABLE result
|
|
|
|
)
|
|
|
|
if(NOT ${result} EQUAL 0)
|
|
|
|
message(FATAL_ERROR "Failed to verify binary!")
|
|
|
|
endif(NOT ${result} EQUAL 0)
|
|
|
|
execute_process(
|
|
|
|
COMMAND spctl --verbose=4 --assess --type execute "${CMAKE_INSTALL_PREFIX}/@EXE@"
|
|
|
|
RESULT_VARIABLE result
|
|
|
|
)
|
|
|
|
if(NOT ${result} EQUAL 0)
|
|
|
|
message(FATAL_ERROR "Failed to verify binary!")
|
|
|
|
endif(NOT ${result} EQUAL 0)
|
|
|
|
endif(@DO_SIGN@)
|