12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- set(app "${CMAKE_INSTALL_PREFIX}/@EXE@")
- set(weprocess "${app}/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
- list(APPEND BINS "Contents/Resources/updater")
- list(APPEND BINS "Contents/Resources/@HELPER_NAME@")
- 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})
- set(ENV{DYLD_LIBRARY_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
- set(ENV{DYLD_FRAMEWORK_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
- # Write qt.conf in the Qt depends directory so that the Qt tools can find QML files
- set(QTCONFCONTENT "[Paths]
- Prefix=@QTROOT@
- ")
- file(WRITE @QTROOT@/bin/qt.conf ${QTCONFCONTENT})
- execute_process(
- COMMAND @QTROOT@/bin/macdeployqt ${args}
- WORKING_DIRECTORY @QTROOT@/bin
- )
- # Run the macdeploy command again to be able to fixup the linked paths for QtWebEngineProcess that
- # is deployed by the first run.
- execute_process(
- COMMAND @QTROOT@/bin/macdeployqt ${app} -executable=${weprocess}/Contents/MacOS/QtWebEngineProcess
- WORKING_DIRECTORY @QTROOT@/bin
- )
- #set(ENTITLEMENTS --entitlements @SOURCE_ROOT@/bundle/osx/Konvergo.entitlements)
- set(CODESIGN codesign ${ENTITLEMENTS} --force --sign "Developer ID Application: Plex Inc.")
- 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@)
- sign_binary(${weprocess})
- file(GLOB_RECURSE LIBS
- FOLLOW_SYMLINKS
- "${app}/*.dylib"
- )
- file(GLOB FRAMEWORKS FOLLOW_SYMLINKS LIST_DIRECTORIES true "${app}/Contents/Frameworks/*")
- foreach(LIB ${LIBS} ${FRAMEWORKS})
- sign_binary(${LIB})
- endforeach(LIB ${LIBS})
- foreach(BIN ${BINS})
- sign_binary(${app}/${BIN})
- endforeach(BIN ${BINS})
- sign_binary(${app})
- 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@)
|