diff --git a/cmake/FixRPaths.cmake b/cmake/FixRPaths.cmake index 803cc0a6d..fd0172e08 100644 --- a/cmake/FixRPaths.cmake +++ b/cmake/FixRPaths.cmake @@ -5,9 +5,16 @@ if(APPLE) foreach(SO ${installedSOs}) if(NOT IS_SYMLINK ${SO}) message("-- Setting runtime path of ${SO}") - execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain + if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") - execute_process(COMMAND codesign -s - --entitlements ${SO}) + message("-- Trying some arm64 codesign stuff for ${SO}") + execute_process(COMMAND codesign -v ${SO} OUTPUT_VARIABLE RESULT) + if(${RESULT} STREQUAL "") + message("-- Removing signature for ${SO}") + execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain + endif() + else() + execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain endif() execute_process(COMMAND install_name_tool -add_rpath "@loader_path/../lib" ${SO}) endif()