VS2022 Remote CMake on MacOS needs to unlock keychain

I have a Developer ID certificate and related private key. But I cannot use them from the VS2022 CMake SSH session because the login keychain is not unlocked automatically for SSH sessions.

To unlock it I need to issue the command:

security unlock-keychain -p password

How can get this to be issued by the CMake session please?
if (APPLE)
do something here?
endif()

probably just prior to install being processed.

Thanks
David

Found a solution

if(APPLE)
add_custom_command(TARGET DeepSkyStacker
POST_BUILD
COMMAND
“/Users/amonra/.unlock_keychain”
)
endif()

1 Like

The problem is that isn’t quite ideal - is it possible can I set up a “PRE_INSTALL” target so this gets run just prior to install rather than at the end of the build.