-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meant only for MacOS/X, and mainly to avoid anoying pop-ups with MPI programs.
- Loading branch information
Mayeul d'Avezac
committed
Nov 5, 2015
1 parent
5b53917
commit f582c14
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Adds the ability to do code signing for macos | ||
# It avoids getting a pop-up all the time when running MPI codes. | ||
# The process is as follows: | ||
# | ||
# Security nerds, avert your eyes. | ||
# | ||
# 1. create a *code-signing* certificate: | ||
# - open key-chain access | ||
# - select the login keychain (top-left panel) | ||
# - menu KeyChain Access/Certificate Assistant/Create a certificate | ||
# - choose a certificate name, self-signed, code-signing | ||
# - curse Apple for not providing a command-line utility | ||
# 1. run cmake with: | ||
# | ||
# ~~~bash | ||
# cmake -DCERTIFICATE="certificate name" . | ||
# ~~~ | ||
# | ||
# 1. to every mpi target, add in the relevant CMakeLists.txt: | ||
# | ||
# ~~~CMake | ||
# add_codesigning(targetname) | ||
# ~~~ | ||
# | ||
# 1. the very first time the certificate is used (during build) click always allow | ||
|
||
set(CERTIFICATE "" CACHE STRING "Name of the certificate to use for code-signing") | ||
function(add_codesign target) | ||
if(APPLE AND CERTIFICATE) | ||
add_custom_command( | ||
TARGET ${target} | ||
POST_BUILD | ||
COMMAND codesign -f -s "${CERTIFICATE}" $<TARGET_FILE:${target}> | ||
COMMENT "Codsigning ${target}" | ||
VERBATIM | ||
) | ||
endif() | ||
endfunction() |